CloneSet72


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
116201.000class_body_declarations[7]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
11161215
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
21161173
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe2.java
Clone Instance
1
Line Count
116
Source Line
1215
Source File
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java

        public void printNewLine() {
                if (this.nlsTagCounter > 0) {
                        return;
                }
                if (lastNumberOfNewLines >= 1) {
                        column = 1; // ensure that the scribe is at the beginning of a new line
                        return;
                }
                addInsertEdit(this.scanner.getCurrentTokenEndPosition() + 1, this.lineSeparator);
                line++;
                lastNumberOfNewLines = 1;
                column = 1;
                needSpace = false;
                this.pendingSpace = false;
        }

        public void printNewLine(int insertPosition) {
                if (this.nlsTagCounter > 0) {
                        return;
                }
                if (lastNumberOfNewLines >= 1) {
                        column = 1; // ensure that the scribe is at the beginning of a new line
                        return;
                }
                addInsertEdit(insertPosition, this.lineSeparator);
                line++;
                lastNumberOfNewLines = 1;
                column = 1;
                needSpace = false;
                this.pendingSpace = false;
        }

        public void printNextToken(int expectedTokenType) {
                printNextToken(expectedTokenType, false);
        }

        public void printNextToken(int expectedTokenType, boolean considerSpaceIfAny) {
                printComment();
                try {
                        this.currentToken = this.scanner.getNextToken();
                        char[] currentTokenSource = this.scanner.getRawTokenSource();
                        if (expectedTokenType != this.currentToken) {
                                throw new AbortFormatting("unexpected token type, expecting:" + expectedTokenType + ", actual:" + this.currentToken); //$NON-NLS-1$//$NON-NLS-2$
                        }
                        this.print(currentTokenSource, considerSpaceIfAny);
                } catch (InvalidInputException e) {
                        throw new AbortFormatting(e);
                  }
        }

        public void printNextToken(int[] expectedTokenTypes) {
                printNextToken(expectedTokenTypes, false);
        }

        public void printNextToken(int[] expectedTokenTypes, boolean considerSpaceIfAny) {
                printComment();
                try {
                        this.currentToken = this.scanner.getNextToken();
                        char[] currentTokenSource = this.scanner.getRawTokenSource();
                        if (Arrays.binarySearch(expectedTokenTypes, this.currentToken) < 0) {
                                StringBuffer expectations = new StringBuffer(5);
                                for (int i = 0; i < expectedTokenTypes.length; i++) {
                                        if (i > 0) {
                                                expectations.append(',');
                                        }
                                        expectations.append(expectedTokenTypes[i]);
                                }
                                throw new AbortFormatting("unexpected token type, expecting:[" + expectations.toString() + "], actual:" + this.currentToken); //$NON-NLS-1$//$NON-NLS-2$
                        }
                        this.print(currentTokenSource, considerSpaceIfAny);
                } catch (InvalidInputException e) {
                        throw new AbortFormatting(e);
                  }
        }

        public void printArrayQualifiedReference(int numberOfTokens, int sourceEnd) {
                int currentTokenStartPosition = this.scanner.currentPosition;
                int numberOfIdentifiers = 0;
                try {
                        do {
                                this.printComment();
                                switch (this.currentToken = this.scanner.getNextToken()) {
                                        case TerminalTokens.TokenNameEOF:
                                                return;
                                        case TerminalTokens.TokenNameWHITESPACE:
                                                addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        case TerminalTokens.TokenNameCOMMENT_BLOCK:
                                        case TerminalTokens.TokenNameCOMMENT_JAVADOC:
                                                this.printBlockComment(this.scanner.getRawTokenSource(), false);
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        case TerminalTokens.TokenNameCOMMENT_LINE:
                                                this.printCommentLine(this.scanner.getRawTokenSource());
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        case TerminalTokens.TokenNameIdentifier:
                                                this.print(this.scanner.getRawTokenSource(), false);
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                if ( ++ numberOfIdentifiers == numberOfTokens) {
                                                        this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
                                                        return;
                                                }
                                                break;
                                        case TerminalTokens.TokenNameDOT:
                                                this.print(this.scanner.getRawTokenSource(), false);
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        default:
                                                this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
                                                return;
                                      }
                        }
                        while (  this.scanner.currentPosition <= sourceEnd);
                } catch (InvalidInputException e) {
                        throw new AbortFormatting(e);
                  }
        }


Clone Instance
2
Line Count
116
Source Line
1173
Source File
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe2.java

        public void printNewLine() {
                if (this.nlsTagCounter > 0) {
                        return;
                }
                if (lastNumberOfNewLines >= 1) {
                        column = 1; // ensure that the scribe is at the beginning of a new line
                        return;
                }
                addInsertEdit(this.scanner.getCurrentTokenEndPosition() + 1, this.lineSeparator);
                line++;
                lastNumberOfNewLines = 1;
                column = 1;
                needSpace = false;
                this.pendingSpace = false;
        }

        public void printNewLine(int insertPosition) {
                if (this.nlsTagCounter > 0) {
                        return;
                }
                if (lastNumberOfNewLines >= 1) {
                        column = 1; // ensure that the scribe is at the beginning of a new line
                        return;
                }
                addInsertEdit(insertPosition, this.lineSeparator);
                line++;
                lastNumberOfNewLines = 1;
                column = 1;
                needSpace = false;
                this.pendingSpace = false;
        }

        public void printNextToken(int expectedTokenType) {
                printNextToken(expectedTokenType, false);
        }

        public void printNextToken(int expectedTokenType, boolean considerSpaceIfAny) {
                printComment();
                try {
                        this.currentToken = this.scanner.getNextToken();
                        char[] currentTokenSource = this.scanner.getRawTokenSource();
                        if (expectedTokenType != this.currentToken) {
                                throw new AbortFormatting("unexpected token type, expecting:" + expectedTokenType + ", actual:" + this.currentToken); //$NON-NLS-1$//$NON-NLS-2$
                        }
                        this.print(currentTokenSource, considerSpaceIfAny);
                } catch (InvalidInputException e) {
                        throw new AbortFormatting(e);
                  }
        }

        public void printNextToken(int[] expectedTokenTypes) {
                printNextToken(expectedTokenTypes, false);
        }

        public void printNextToken(int[] expectedTokenTypes, boolean considerSpaceIfAny) {
                printComment();
                try {
                        this.currentToken = this.scanner.getNextToken();
                        char[] currentTokenSource = this.scanner.getRawTokenSource();
                        if (Arrays.binarySearch(expectedTokenTypes, this.currentToken) < 0) {
                                StringBuffer expectations = new StringBuffer(5);
                                for (int i = 0; i < expectedTokenTypes.length; i++) {
                                        if (i > 0) {
                                                expectations.append(',');
                                        }
                                        expectations.append(expectedTokenTypes[i]);
                                }
                                throw new AbortFormatting("unexpected token type, expecting:[" + expectations.toString() + "], actual:" + this.currentToken); //$NON-NLS-1$//$NON-NLS-2$
                        }
                        this.print(currentTokenSource, considerSpaceIfAny);
                } catch (InvalidInputException e) {
                        throw new AbortFormatting(e);
                  }
        }

        public void printArrayQualifiedReference(int numberOfTokens, int sourceEnd) {
                int currentTokenStartPosition = this.scanner.currentPosition;
                int numberOfIdentifiers = 0;
                try {
                        do {
                                this.printComment();
                                switch (this.currentToken = this.scanner.getNextToken()) {
                                        case TerminalTokens.TokenNameEOF:
                                                return;
                                        case TerminalTokens.TokenNameWHITESPACE:
                                                addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        case TerminalTokens.TokenNameCOMMENT_BLOCK:
                                        case TerminalTokens.TokenNameCOMMENT_JAVADOC:
                                                this.printBlockComment(this.scanner.getRawTokenSource(), false);
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        case TerminalTokens.TokenNameCOMMENT_LINE:
                                                this.printCommentLine(this.scanner.getRawTokenSource());
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        case TerminalTokens.TokenNameIdentifier:
                                                this.print(this.scanner.getRawTokenSource(), false);
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                if ( ++ numberOfIdentifiers == numberOfTokens) {
                                                        this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
                                                        return;
                                                }
                                                break;
                                        case TerminalTokens.TokenNameDOT:
                                                this.print(this.scanner.getRawTokenSource(), false);
                                                currentTokenStartPosition = this.scanner.currentPosition;
                                                break;
                                        default:
                                                this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
                                                return;
                                      }
                        }
                        while (  this.scanner.currentPosition <= sourceEnd);
                } catch (InvalidInputException e) {
                        throw new AbortFormatting(e);
                  }
        }


Clone AbstractionParameter Count: 0Parameter Bindings

public void printNewLine() {
  if (this.nlsTagCounter > 0) {
    return;
  }
  if (lastNumberOfNewLines >= 1) {
    column = 1; // ensure that the scribe is at the beginning of a new line
    return;
  }
  addInsertEdit(this.scanner.getCurrentTokenEndPosition() + 1, this.lineSeparator);
  line++;
  lastNumberOfNewLines = 1;
  column = 1;
  needSpace = false;
  this.pendingSpace = false;
}

public void printNewLine(int insertPosition) {
  if (this.nlsTagCounter > 0) {
    return;
  }
  if (lastNumberOfNewLines >= 1) {
    column = 1; // ensure that the scribe is at the beginning of a new line
    return;
  }
  addInsertEdit(insertPosition, this.lineSeparator);
  line++;
  lastNumberOfNewLines = 1;
  column = 1;
  needSpace = false;
  this.pendingSpace = false;
}

public void printNextToken(int expectedTokenType) {
  printNextToken(expectedTokenType, false);
}

public void printNextToken(int expectedTokenType, boolean considerSpaceIfAny) {
  printComment();
  try {
    this.currentToken = this.scanner.getNextToken();
    char[] currentTokenSource = this.scanner.getRawTokenSource();
    if (expectedTokenType != this.currentToken) {
      throw new AbortFormatting("unexpected token type, expecting:" + expectedTokenType + ", actual:" + this.currentToken); //$NON-NLS-1$//$NON-NLS-2$
    }
    this.print(currentTokenSource, considerSpaceIfAny);
  }
  catch (InvalidInputException e) {
    throw new AbortFormatting(e);
  }
}

public void printNextToken(int[] expectedTokenTypes) {
  printNextToken(expectedTokenTypes, false);
}

public void printNextToken(int[] expectedTokenTypes, boolean considerSpaceIfAny) {
  printComment();
  try {
    this.currentToken = this.scanner.getNextToken();
    char[] currentTokenSource = this.scanner.getRawTokenSource();
    if (Arrays.binarySearch(expectedTokenTypes, this.currentToken) < 0) {
      StringBuffer expectations = new StringBuffer(5);
      for (int i = 0; i < expectedTokenTypes.length; i++) {
        if (i > 0) {
          expectations.append(',');
        }
        expectations.append(expectedTokenTypes[i]);
      }
      throw new AbortFormatting("unexpected token type, expecting:[" + expectations.toString() + "], actual:" + this.currentToken); //$NON-NLS-1$//$NON-NLS-2$
    }
    this.print(currentTokenSource, considerSpaceIfAny);
  }
  catch (InvalidInputException e) {
    throw new AbortFormatting(e);
  }
}

public void printArrayQualifiedReference(int numberOfTokens, int sourceEnd) {
  int currentTokenStartPosition = this.scanner.currentPosition;
  int numberOfIdentifiers = 0;
  try {
    do {
      this.printComment();
      switch (this.currentToken = this.scanner.getNextToken()) {
        case TerminalTokens.TokenNameEOF:
          return;
        case TerminalTokens.TokenNameWHITESPACE:
          addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
          currentTokenStartPosition = this.scanner.currentPosition;
          break;
        case TerminalTokens.TokenNameCOMMENT_BLOCK:
        case TerminalTokens.TokenNameCOMMENT_JAVADOC:
          this.printBlockComment(this.scanner.getRawTokenSource(), false);
          currentTokenStartPosition = this.scanner.currentPosition;
          break;
        case TerminalTokens.TokenNameCOMMENT_LINE:
          this.printCommentLine(this.scanner.getRawTokenSource());
          currentTokenStartPosition = this.scanner.currentPosition;
          break;
        case TerminalTokens.TokenNameIdentifier:
          this.print(this.scanner.getRawTokenSource(), false);
          currentTokenStartPosition = this.scanner.currentPosition;
          if ( ++numberOfIdentifiers == numberOfTokens) {
            this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
            return;
          }
          break;
        case TerminalTokens.TokenNameDOT:
          this.print(this.scanner.getRawTokenSource(), false);
          currentTokenStartPosition = this.scanner.currentPosition;
          break;
        default:
          this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
          return;
      }
    }
    while (this.scanner.currentPosition <= sourceEnd);
  }
  catch (InvalidInputException e) {
    throw new AbortFormatting(e);
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None