Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
31 | 2 | 0 | 1.000 | statement_sequence[6] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 31 | 182 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java |
2 | 31 | 168 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java |
| ||||
fCreated.clear(); final ICompilationUnit unit = fType.getCompilationUnit(); final CompilationUnitRewrite rewrite = new CompilationUnitRewrite(unit, fUnit); ITypeBinding binding = null; ListRewrite rewriter = null; if (fType.isAnonymous()) { final IJavaElement parent = fType.getParent(); if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) { final EnumConstantDeclaration constant = (EnumConstantDeclaration) NodeFinder.perform(rewrite.getRoot(), ((ISourceReference) parent).getSourceRange()); if (constant != null) { final AnonymousClassDeclaration declaration = constant.getAnonymousClassDeclaration(); if (declaration != null) { binding = declaration.resolveBinding(); if (binding != null) rewriter = rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); } } } else { final ClassInstanceCreation creation = (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), ClassInstanceCreation.class ); if (creation != null) { binding = creation.resolveTypeBinding(); final AnonymousClassDeclaration declaration = creation.getAnonymousClassDeclaration(); if (declaration != null) rewriter = rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); } } } else { final AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), AbstractTypeDeclaration.class ); if (declaration != null) { binding = declaration.resolveBinding(); rewriter = rewrite.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()); } } |
| ||||
fCreated.clear(); final ICompilationUnit unit = fType.getCompilationUnit(); final CompilationUnitRewrite rewrite = new CompilationUnitRewrite(unit, fUnit); ITypeBinding binding = null; ListRewrite rewriter = null; if (fType.isAnonymous()) { final IJavaElement parent = fType.getParent(); if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) { final EnumConstantDeclaration constant = (EnumConstantDeclaration) NodeFinder.perform(rewrite.getRoot(), ((ISourceReference) parent).getSourceRange()); if (constant != null) { final AnonymousClassDeclaration declaration = constant.getAnonymousClassDeclaration(); if (declaration != null) { binding = declaration.resolveBinding(); if (binding != null) rewriter = rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); } } } else { final ClassInstanceCreation creation = (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), ClassInstanceCreation.class ); if (creation != null) { binding = creation.resolveTypeBinding(); final AnonymousClassDeclaration declaration = creation.getAnonymousClassDeclaration(); if (declaration != null) rewriter = rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); } } } else { final AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), AbstractTypeDeclaration.class ); if (declaration != null) { binding = declaration.resolveBinding(); rewriter = rewrite.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()); } } |
| |||
fCreated.clear(); final ICompilationUnit unit = fType.getCompilationUnit(); final CompilationUnitRewrite rewrite = new CompilationUnitRewrite(unit, fUnit); ITypeBinding binding = null; ListRewrite rewriter = null; if (fType.isAnonymous()) { final IJavaElement parent = fType.getParent(); if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) { final EnumConstantDeclaration constant = (EnumConstantDeclaration) NodeFinder.perform(rewrite.getRoot(), ((ISourceReference) parent).getSourceRange()); if (constant != null) { final AnonymousClassDeclaration declaration = constant.getAnonymousClassDeclaration(); if (declaration != null) { binding = declaration.resolveBinding(); if (binding != null) rewriter = rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); } } } else { final ClassInstanceCreation creation = (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), ClassInstanceCreation.class ); if (creation != null) { binding = creation.resolveTypeBinding(); final AnonymousClassDeclaration declaration = creation.getAnonymousClassDeclaration(); if (declaration != null) rewriter = rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY); } } } else { final AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), AbstractTypeDeclaration.class ); if (declaration != null) { binding = declaration.resolveBinding(); rewriter = rewrite.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
None |