Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
16 | 4 | 5 | 0.956 | method_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 16 | 199 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SortElementsOperation.java |
2 | 16 | 216 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SortElementsOperation.java |
3 | 16 | 234 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SortElementsOperation.java |
4 | 16 | 252 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SortElementsOperation.java |
| ||||
public boolean visit(org.eclipse.jdt.core.dom.CompilationUnit compilationUnit) { if (checkMalformedNodes(compilationUnit)) { return true; // abort sorting of current element } ListRewrite listRewrite = rewriter.getListRewrite(compilationUnit, org.eclipse.jdt.core.dom.CompilationUnit.TYPES_PROPERTY); List types = compilationUnit.types(); final int length = types.size(); if (length > 1) { final List myCopy = new ArrayList(); myCopy.addAll(types); Collections.sort(myCopy, SortElementsOperation.this.comparator); for (int i = 0; i < length; i++) { listRewrite.replace((ASTNode) types.get(i), rewriter.createMoveTarget((ASTNode) myCopy.get(i)), null); } } return true; } |
| ||||
public boolean visit(AnnotationTypeDeclaration annotationTypeDeclaration) { if (checkMalformedNodes(annotationTypeDeclaration)) { return true; // abort sorting of current element } ListRewrite listRewrite = rewriter.getListRewrite(annotationTypeDeclaration, AnnotationTypeDeclaration.BODY_DECLARATIONS_PROPERTY); List bodyDeclarations = annotationTypeDeclaration.bodyDeclarations(); final int length = bodyDeclarations.size(); if (length > 1) { final List myCopy = new ArrayList(); myCopy.addAll(bodyDeclarations); Collections.sort(myCopy, SortElementsOperation.this.comparator); for (int i = 0; i < length; i++) { listRewrite.replace((ASTNode) bodyDeclarations.get(i), rewriter.createMoveTarget((ASTNode) myCopy.get(i)), null); } } return true; } |
| ||||
public boolean visit(AnonymousClassDeclaration anonymousClassDeclaration) { if (checkMalformedNodes(anonymousClassDeclaration)) { return true; // abort sorting of current element } ListRewrite listRewrite = rewriter.getListRewrite(anonymousClassDeclaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations(); final int length = bodyDeclarations.size(); if (length > 1) { final List myCopy = new ArrayList(); myCopy.addAll(bodyDeclarations); Collections.sort(myCopy, SortElementsOperation.this.comparator); for (int i = 0; i < length; i++) { listRewrite.replace((ASTNode) bodyDeclarations.get(i), rewriter.createMoveTarget((ASTNode) myCopy.get(i)), null); } } return true; } |
| ||||
public boolean visit(TypeDeclaration typeDeclaration) { if (checkMalformedNodes(typeDeclaration)) { return true; // abort sorting of current element } ListRewrite listRewrite = rewriter.getListRewrite(typeDeclaration, TypeDeclaration.BODY_DECLARATIONS_PROPERTY); List bodyDeclarations = typeDeclaration.bodyDeclarations(); final int length = bodyDeclarations.size(); if (length > 1) { final List myCopy = new ArrayList(); myCopy.addAll(bodyDeclarations); Collections.sort(myCopy, SortElementsOperation.this.comparator); for (int i = 0; i < length; i++) { listRewrite.replace((ASTNode) bodyDeclarations.get(i), rewriter.createMoveTarget((ASTNode) myCopy.get(i)), null); } } return true; } |
| |||
public boolean visit( [[#variable9681d000]] [[#variable9681cfa0]]) { if (checkMalformedNodes( [[#variable9681cfa0]])) { return true; // abort sorting of current element } ListRewrite listRewrite = rewriter.getListRewrite( [[#variable9681cfa0]], [[#variable9681cf20]]. [[#variable9681ce80]]); List [[#variable9681ce00]]= [[#variable9681cfa0]]. [[#variable9681ce00]](); final int length = [[#variable9681ce00]].size(); if (length > 1) { final List myCopy = new ArrayList(); myCopy.addAll( [[#variable9681ce00]]); Collections.sort(myCopy, SortElementsOperation.this.comparator); for (int i = 0; i < length; i++) { listRewrite.replace((ASTNode) [[#variable9681ce00]].get(i), rewriter.createMoveTarget((ASTNode) myCopy.get(i)), null); } } return true; } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#9681d000]] | TypeDeclaration |
1 | 2 | [[#9681d000]] | AnonymousClassDeclaration |
1 | 3 | [[#9681d000]] | AnnotationTypeDeclaration |
1 | 4 | [[#9681d000]] | org.eclipse.jdt.core.dom.CompilationUnit |
2 | 1 | [[#9681cfa0]] | typeDeclaration |
2 | 2 | [[#9681cfa0]] | anonymousClassDeclaration |
2 | 3 | [[#9681cfa0]] | annotationTypeDeclaration |
2 | 4 | [[#9681cfa0]] | compilationUnit |
3 | 1 | [[#9681cf20]] | TypeDeclaration |
3 | 2 | [[#9681cf20]] | AnonymousClassDeclaration |
3 | 3 | [[#9681cf20]] | AnnotationTypeDeclaration |
3 | 4 | [[#9681cf20]] | org.eclipse.jdt.core.dom.CompilationUnit |
4 | 1 | [[#9681ce80]] | BODY_DECLARATIONS_PROPERTY |
4 | 2 | [[#9681ce80]] | BODY_DECLARATIONS_PROPERTY |
4 | 3 | [[#9681ce80]] | BODY_DECLARATIONS_PROPERTY |
4 | 4 | [[#9681ce80]] | TYPES_PROPERTY |
5 | 1 | [[#9681ce00]] | bodyDeclarations |
5 | 2 | [[#9681ce00]] | bodyDeclarations |
5 | 3 | [[#9681ce00]] | bodyDeclarations |
5 | 4 | [[#9681ce00]] | types |