| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 48 | 2 | 3 | 0.988 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 52 | 95 | plugins/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java |
| 2 | 48 | 183 | plugins/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java |
| ||||
protected void consumeClassHeaderName1() {
// ClassHeaderName ::= Modifiersopt 'class' 'Identifier'
TypeDeclaration typeDecl;
if (this.nestedMethod[this.nestedType] == 0) {
if (this.nestedType != 0) {
typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.bits |= ASTNode.IsMemberType;
}
else {
typeDecl = new CodeSnippetTypeDeclaration(this.compilationUnit.compilationResult);
}
}
else {
// Record that the block has a declaration for local types
typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.bits |= ASTNode.IsLocalType;
markEnclosingMemberWithLocalType();
blockReal();
}
//highlight the name of the type
long pos = this.identifierPositionStack[this.identifierPtr];
typeDecl.sourceEnd = (int) pos;
typeDecl.sourceStart = (int) (pos >>> 32);
typeDecl.name = this.identifierStack[this.identifierPtr-- ];
this.identifierLengthPtr--;
//compute the declaration source too
typeDecl.declarationSourceStart = this.intStack[this.intPtr-- ];
this.intPtr--;
// 'class' and 'interface' push an int position
typeDecl.modifiersSourceStart = this.intStack[this.intPtr-- ];
typeDecl.modifiers = this.intStack[this.intPtr-- ];
if (typeDecl.modifiersSourceStart >= 0) {
typeDecl.declarationSourceStart = typeDecl.modifiersSourceStart;
}
typeDecl.bodyStart = typeDecl.sourceEnd + 1;
pushOnAstStack(typeDecl);
this.listLength = 0; // will be updated when reading super-interfaces
// recovery
if (this.currentElement != null) {
this.lastCheckPoint = typeDecl.bodyStart;
this.currentElement = this.currentElement.add(typeDecl, 0);
this.lastIgnoredToken = -1;
}
// javadoc
typeDecl.javadoc = this.javadoc;
this.javadoc = null;
}
protected void consumeEmptyStatement() {
super.consumeEmptyStatement();
/* recovery */
recordLastStatementIfNeeded();
}
|
| ||||
protected void consumeInterfaceHeaderName1() {
// InterfaceHeaderName ::= Modifiersopt 'interface' 'Identifier'
TypeDeclaration typeDecl;
if (this.nestedMethod[this.nestedType] == 0) {
if (this.nestedType != 0) {
typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.bits |= ASTNode.IsMemberType;
}
else {
typeDecl = new CodeSnippetTypeDeclaration(this.compilationUnit.compilationResult);
}
}
else {
// Record that the block has a declaration for local types
typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.bits |= ASTNode.IsLocalType;
markEnclosingMemberWithLocalType();
blockReal();
}
//highlight the name of the type
long pos = this.identifierPositionStack[this.identifierPtr];
typeDecl.sourceEnd = (int) pos;
typeDecl.sourceStart = (int) (pos >>> 32);
typeDecl.name = this.identifierStack[this.identifierPtr-- ];
this.identifierLengthPtr--;
//compute the declaration source too
typeDecl.declarationSourceStart = this.intStack[this.intPtr-- ];
this.intPtr--;
// 'class' and 'interface' push an int position
typeDecl.modifiersSourceStart = this.intStack[this.intPtr-- ];
typeDecl.modifiers = this.intStack[this.intPtr-- ];
if (typeDecl.modifiersSourceStart >= 0) {
typeDecl.declarationSourceStart = typeDecl.modifiersSourceStart;
}
typeDecl.bodyStart = typeDecl.sourceEnd + 1;
pushOnAstStack(typeDecl);
this.listLength = 0; // will be updated when reading super-interfaces
// recovery
if (this.currentElement != null) { // is recovering
this.lastCheckPoint = typeDecl.bodyStart;
this.currentElement = this.currentElement.add(typeDecl, 0);
this.lastIgnoredToken = -1;
}
// javadoc
typeDecl.javadoc = this.javadoc;
this.javadoc = null;
}
protected void consumeInternalCompilationUnit() {
// InternalCompilationUnit ::= PackageDeclaration
// InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports
// InternalCompilationUnit ::= ImportDeclarations ReduceImports
}
|
| |||
protected void [[#variable97ee8060]]() {
// InterfaceHeaderName ::= Modifiersopt 'interface' 'Identifier'
// ClassHeaderName ::= Modifiersopt 'class' 'Identifier'
TypeDeclaration typeDecl;
if (this.nestedMethod[this.nestedType] == 0) {
if (this.nestedType != 0) {
typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.bits |= ASTNode.IsMemberType;
}
else {
typeDecl = new CodeSnippetTypeDeclaration(this.compilationUnit.compilationResult);
}
}
else {
// Record that the block has a declaration for local types
typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.bits |= ASTNode.IsLocalType;
markEnclosingMemberWithLocalType();
blockReal();
}
//highlight the name of the type
long pos = this.identifierPositionStack[this.identifierPtr];
typeDecl.sourceEnd = (int) pos;
typeDecl.sourceStart = (int) (pos >>> 32);
typeDecl.name = this.identifierStack[this.identifierPtr-- ];
this.identifierLengthPtr--;
//compute the declaration source too
typeDecl.declarationSourceStart = this.intStack[this.intPtr-- ];
this.intPtr--;
// 'class' and 'interface' push an int position
typeDecl.modifiersSourceStart = this.intStack[this.intPtr-- ];
typeDecl.modifiers = this.intStack[this.intPtr-- ];
if (typeDecl.modifiersSourceStart >= 0) {
typeDecl.declarationSourceStart = typeDecl.modifiersSourceStart;
}
typeDecl.bodyStart = typeDecl.sourceEnd + 1;
pushOnAstStack(typeDecl);
this.listLength = 0; // will be updated when reading super-interfaces
// recovery
if (this.currentElement != null) { // is recovering
this.lastCheckPoint = typeDecl.bodyStart;
this.currentElement = this.currentElement.add(typeDecl, 0);
this.lastIgnoredToken = -1;
}
// javadoc
typeDecl.javadoc = this.javadoc;
this.javadoc = null;
}
protected void [[#variablec27a65c0]]() [[#variablec27a6560]]
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#97ee8060]] | consumeInterfaceHeaderName1 |
| 1 | 2 | [[#97ee8060]] | consumeClassHeaderName1 |
| 2 | 1 | [[#c27a65c0]] | consumeInternalCompilationUnit |
| 2 | 2 | [[#c27a65c0]] | consumeEmptyStatement |
| 3 | 1 | [[#c27a6560]] | {
// InternalCompilationUnit ::= PackageDeclaration
// InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports
// InternalCompilationUnit ::= ImportDeclarations ReduceImports
} |
| 3 | 2 | [[#c27a6560]] | {
super.consumeEmptyStatement();
/* recovery */
recordLastStatementIfNeeded();
} |