Skip to content

Commit

Permalink
remove unnecessary casts (covariant IndexInput.clone)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x@1375500 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mikemccand committed Aug 21, 2012
1 parent a431576 commit 7c8efea
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ final class BlockDocsEnum extends DocsEnum {

public BlockDocsEnum(FieldInfo fieldInfo) throws IOException {
this.startDocIn = BlockPostingsReader.this.docIn;
this.docIn = (IndexInput) startDocIn.clone();
this.docIn = startDocIn.clone();
indexHasFreq = fieldInfo.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS) >= 0;
indexHasPos = fieldInfo.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
indexHasOffsets = fieldInfo.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
Expand Down Expand Up @@ -486,7 +486,7 @@ public int advance(int target) throws IOException {

if (skipper == null) {
// Lazy init: first time this enum has ever been used for skipping
skipper = new BlockSkipReader((IndexInput) docIn.clone(),
skipper = new BlockSkipReader(docIn.clone(),
BlockPostingsWriter.maxSkipLevels,
BLOCK_SIZE,
indexHasPos,
Expand Down Expand Up @@ -629,8 +629,8 @@ final class BlockDocsAndPositionsEnum extends DocsAndPositionsEnum {

public BlockDocsAndPositionsEnum(FieldInfo fieldInfo) throws IOException {
this.startDocIn = BlockPostingsReader.this.docIn;
this.docIn = (IndexInput) startDocIn.clone();
this.posIn = (IndexInput) BlockPostingsReader.this.posIn.clone();
this.docIn = startDocIn.clone();
this.posIn = BlockPostingsReader.this.posIn.clone();
encoded = new byte[MAX_ENCODED_SIZE];
indexHasOffsets = fieldInfo.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
indexHasPayloads = fieldInfo.hasPayloads();
Expand Down Expand Up @@ -795,7 +795,7 @@ public int advance(int target) throws IOException {
// if (DEBUG) {
// System.out.println(" create skipper");
// }
skipper = new BlockSkipReader((IndexInput) docIn.clone(),
skipper = new BlockSkipReader(docIn.clone(),
BlockPostingsWriter.maxSkipLevels,
BLOCK_SIZE,
true,
Expand Down Expand Up @@ -1046,9 +1046,9 @@ final class EverythingEnum extends DocsAndPositionsEnum {

public EverythingEnum(FieldInfo fieldInfo) throws IOException {
this.startDocIn = BlockPostingsReader.this.docIn;
this.docIn = (IndexInput) startDocIn.clone();
this.posIn = (IndexInput) BlockPostingsReader.this.posIn.clone();
this.payIn = (IndexInput) BlockPostingsReader.this.payIn.clone();
this.docIn = startDocIn.clone();
this.posIn = BlockPostingsReader.this.posIn.clone();
this.payIn = BlockPostingsReader.this.payIn.clone();
encoded = new byte[MAX_ENCODED_SIZE];
indexHasOffsets = fieldInfo.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
if (indexHasOffsets) {
Expand Down Expand Up @@ -1278,7 +1278,7 @@ public int advance(int target) throws IOException {
// if (DEBUG) {
// System.out.println(" create skipper");
// }
skipper = new BlockSkipReader((IndexInput) docIn.clone(),
skipper = new BlockSkipReader(docIn.clone(),
BlockPostingsWriter.maxSkipLevels,
BLOCK_SIZE,
true,
Expand Down

0 comments on commit 7c8efea

Please sign in to comment.