Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
62 | 2 | 2 | 0.994 | statement_sequence[9] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 62 | 127 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java |
2 | 62 | 266 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java |
| ||||
org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = typeDeclaration.fields; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = typeDeclaration.methods; int fieldsLength = fields == null ? 0: fields.length; int methodsLength = methods == null ? 0: methods.length; int membersLength = members == null ? 0: members.length; int fieldsIndex = 0; int methodsIndex = 0; int membersIndex = 0; while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) { org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; int position = Integer.MAX_VALUE; int nextDeclarationType = -1; if (fieldsIndex < fieldsLength) { nextFieldDeclaration = fields[fieldsIndex]; if (nextFieldDeclaration.declarationSourceStart < position) { position = nextFieldDeclaration.declarationSourceStart; nextDeclarationType = 0; // FIELD } } if (methodsIndex < methodsLength) { nextMethodDeclaration = methods[methodsIndex]; if (nextMethodDeclaration.declarationSourceStart < position) { position = nextMethodDeclaration.declarationSourceStart; nextDeclarationType = 1; // METHOD } } if (membersIndex < membersLength) { nextMemberDeclaration = members[membersIndex]; if (nextMemberDeclaration.declarationSourceStart < position) { position = nextMemberDeclaration.declarationSourceStart; nextDeclarationType = 2; // MEMBER } } switch (nextDeclarationType) { case 0: if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) { typeDecl.bodyDeclarations().add(convert(nextFieldDeclaration)); } else { checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, typeDecl.bodyDeclarations()); } fieldsIndex++; break; case 1: methodsIndex++; if ( !nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { typeDecl.bodyDeclarations().add(convert(nextMethodDeclaration)); } break; case 2: membersIndex++; ASTNode node = convert(nextMemberDeclaration); if (node == null) { typeDecl.setFlags(typeDecl.getFlags()| ASTNode.MALFORMED); } else { typeDecl.bodyDeclarations().add(node); } } } |
| ||||
org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = expression.fields; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = expression.methods; int fieldsLength = fields == null ? 0: fields.length; int methodsLength = methods == null ? 0: methods.length; int membersLength = members == null ? 0: members.length; int fieldsIndex = 0; int methodsIndex = 0; int membersIndex = 0; while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) { org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; int position = Integer.MAX_VALUE; int nextDeclarationType = -1; if (fieldsIndex < fieldsLength) { nextFieldDeclaration = fields[fieldsIndex]; if (nextFieldDeclaration.declarationSourceStart < position) { position = nextFieldDeclaration.declarationSourceStart; nextDeclarationType = 0; // FIELD } } if (methodsIndex < methodsLength) { nextMethodDeclaration = methods[methodsIndex]; if (nextMethodDeclaration.declarationSourceStart < position) { position = nextMethodDeclaration.declarationSourceStart; nextDeclarationType = 1; // METHOD } } if (membersIndex < membersLength) { nextMemberDeclaration = members[membersIndex]; if (nextMemberDeclaration.declarationSourceStart < position) { position = nextMemberDeclaration.declarationSourceStart; nextDeclarationType = 2; // MEMBER } } switch (nextDeclarationType) { case 0: if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) { anonymousClassDeclaration.bodyDeclarations().add(convert(nextFieldDeclaration)); } else { checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, anonymousClassDeclaration.bodyDeclarations()); } fieldsIndex++; break; case 1: methodsIndex++; if ( !nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { anonymousClassDeclaration.bodyDeclarations().add(convert(nextMethodDeclaration)); } break; case 2: membersIndex++; ASTNode node = convert(nextMemberDeclaration); if (node == null) { anonymousClassDeclaration.setFlags(anonymousClassDeclaration.getFlags()| ASTNode.MALFORMED); } else { anonymousClassDeclaration.bodyDeclarations().add(node); } } } |
| |||
org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = [[#variable54d712c0]].fields; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = [[#variable54d712c0]].methods; int fieldsLength = fields == null ? 0: fields.length; int methodsLength = methods == null ? 0: methods.length; int membersLength = members == null ? 0: members.length; int fieldsIndex = 0; int methodsIndex = 0; int membersIndex = 0; while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) { org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; int position = Integer.MAX_VALUE; int nextDeclarationType = -1; if (fieldsIndex < fieldsLength) { nextFieldDeclaration = fields[fieldsIndex]; if (nextFieldDeclaration.declarationSourceStart < position) { position = nextFieldDeclaration.declarationSourceStart; nextDeclarationType = 0; // FIELD } } if (methodsIndex < methodsLength) { nextMethodDeclaration = methods[methodsIndex]; if (nextMethodDeclaration.declarationSourceStart < position) { position = nextMethodDeclaration.declarationSourceStart; nextDeclarationType = 1; // METHOD } } if (membersIndex < membersLength) { nextMemberDeclaration = members[membersIndex]; if (nextMemberDeclaration.declarationSourceStart < position) { position = nextMemberDeclaration.declarationSourceStart; nextDeclarationType = 2; // MEMBER } } switch (nextDeclarationType) { case 0: if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) { [[#variable54d71220]].bodyDeclarations().add(convert(nextFieldDeclaration)); } else { checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, [[#variable54d71220]].bodyDeclarations()); } fieldsIndex++; break; case 1: methodsIndex++; if ( !nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { [[#variable54d71220]].bodyDeclarations().add(convert(nextMethodDeclaration)); } break; case 2: membersIndex++; ASTNode node = convert(nextMemberDeclaration); if (node == null) { [[#variable54d71220]].setFlags( [[#variable54d71220]].getFlags()|ASTNode.MALFORMED); } else { [[#variable54d71220]].bodyDeclarations().add(node); } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#54d712c0]] | typeDeclaration |
1 | 2 | [[#54d712c0]] | expression |
2 | 1 | [[#54d71220]] | typeDecl |
2 | 2 | [[#54d71220]] | anonymousClassDeclaration |