CloneSet233


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
31201.000statement_sequence[6]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
131182
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java
231168
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java
Clone Instance
1
Line Count
31
Source Line
182
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.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());
                                }
                        }


Clone Instance
2
Line Count
31
Source Line
168
Source File
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());
                                }
                        }


Clone AbstractionParameter Count: 0Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None