Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
116 | 2 | 0 | 1.000 | class_body_declarations[7] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 116 | 1215 | plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java |
2 | 116 | 1173 | 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); } } |
| ||||
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); } } |
| |||
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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
None |