mirror of
https://github.com/apache/lucene.git
synced 2025-03-06 08:19:23 +00:00
Remove more clone warnings
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1308122 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5ab0204216
commit
7cc871d9f2
@ -125,7 +125,7 @@ public class TestTermInfosReaderIndex extends LuceneTestCase {
|
||||
|
||||
public void testSeekEnum() throws CorruptIndexException, IOException {
|
||||
int indexPosition = 3;
|
||||
SegmentTermEnum clone = (SegmentTermEnum) termEnum.clone();
|
||||
SegmentTermEnum clone = termEnum.clone();
|
||||
Term term = findTermThatWouldBeAtIndex(clone, indexPosition);
|
||||
SegmentTermEnum enumerator = clone;
|
||||
index.seekEnum(enumerator, indexPosition);
|
||||
|
@ -80,7 +80,7 @@ public class TestPayloads extends LuceneTestCase {
|
||||
// expected exception
|
||||
}
|
||||
|
||||
Payload clone = (Payload) payload.clone();
|
||||
Payload clone = payload.clone();
|
||||
assertEquals(payload.length(), clone.length());
|
||||
for (int i = 0; i < payload.length(); i++) {
|
||||
assertEquals(payload.byteAt(i), clone.byteAt(i));
|
||||
|
@ -183,14 +183,14 @@ public class TestOpenBitSet extends LuceneTestCase {
|
||||
fromIndex = random.nextInt(sz+80);
|
||||
toIndex = fromIndex + random.nextInt((sz>>1)+1);
|
||||
BitSet aa = (BitSet)a.clone(); aa.flip(fromIndex,toIndex);
|
||||
OpenBitSet bb = (OpenBitSet)b.clone(); bb.flip(fromIndex,toIndex);
|
||||
OpenBitSet bb = b.clone(); bb.flip(fromIndex,toIndex);
|
||||
|
||||
doIterate(aa,bb, mode); // a problem here is from flip or doIterate
|
||||
|
||||
fromIndex = random.nextInt(sz+80);
|
||||
toIndex = fromIndex + random.nextInt((sz>>1)+1);
|
||||
aa = (BitSet)a.clone(); aa.clear(fromIndex,toIndex);
|
||||
bb = (OpenBitSet)b.clone(); bb.clear(fromIndex,toIndex);
|
||||
bb = b.clone(); bb.clear(fromIndex,toIndex);
|
||||
|
||||
doNextSetBit(aa,bb); // a problem here is from clear() or nextSetBit
|
||||
doNextSetBitLong(aa,bb);
|
||||
@ -201,7 +201,7 @@ public class TestOpenBitSet extends LuceneTestCase {
|
||||
fromIndex = random.nextInt(sz+80);
|
||||
toIndex = fromIndex + random.nextInt((sz>>1)+1);
|
||||
aa = (BitSet)a.clone(); aa.set(fromIndex,toIndex);
|
||||
bb = (OpenBitSet)b.clone(); bb.set(fromIndex,toIndex);
|
||||
bb = b.clone(); bb.set(fromIndex,toIndex);
|
||||
|
||||
doNextSetBit(aa,bb); // a problem here is from set() or nextSetBit
|
||||
doNextSetBitLong(aa,bb);
|
||||
@ -219,10 +219,10 @@ public class TestOpenBitSet extends LuceneTestCase {
|
||||
BitSet a_xor = (BitSet)a.clone(); a_xor.xor(a0);
|
||||
BitSet a_andn = (BitSet)a.clone(); a_andn.andNot(a0);
|
||||
|
||||
OpenBitSet b_and = (OpenBitSet)b.clone(); assertEquals(b,b_and); b_and.and(b0);
|
||||
OpenBitSet b_or = (OpenBitSet)b.clone(); b_or.or(b0);
|
||||
OpenBitSet b_xor = (OpenBitSet)b.clone(); b_xor.xor(b0);
|
||||
OpenBitSet b_andn = (OpenBitSet)b.clone(); b_andn.andNot(b0);
|
||||
OpenBitSet b_and = b.clone(); assertEquals(b,b_and); b_and.and(b0);
|
||||
OpenBitSet b_or = b.clone(); b_or.or(b0);
|
||||
OpenBitSet b_xor = b.clone(); b_xor.xor(b0);
|
||||
OpenBitSet b_andn = b.clone(); b_andn.andNot(b0);
|
||||
|
||||
doIterate(a_and,b_and, mode);
|
||||
doIterate(a_or,b_or, mode);
|
||||
|
@ -53,10 +53,10 @@ public class QueryUtils {
|
||||
|
||||
/** check very basic hashCode and equals */
|
||||
public static void checkHashEquals(Query q) {
|
||||
Query q2 = (Query)q.clone();
|
||||
Query q2 = q.clone();
|
||||
checkEqual(q,q2);
|
||||
|
||||
Query q3 = (Query)q.clone();
|
||||
Query q3 = q.clone();
|
||||
q3.setBoost(7.21792348f);
|
||||
checkUnequal(q,q3);
|
||||
|
||||
@ -120,7 +120,7 @@ public class QueryUtils {
|
||||
}
|
||||
checkExplanations(q1,s);
|
||||
|
||||
Query q2 = (Query)q1.clone();
|
||||
Query q2 = q1.clone();
|
||||
checkEqual(s.rewrite(q1),
|
||||
s.rewrite(q2));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user