CloneSet746


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
18210.998class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
118296
plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java
218281
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java
Clone Instance
1
Line Count
18
Source Line
296
Source File
plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java

        public static String[] getParameterTypeNamesForSeeTag(IMethod overridden) {
                try {
                        ASTParser parser = ASTParser.newParser(AST.JLS3);
                        parser.setProject(overridden.getJavaProject());
                        IBinding[] bindings = parser.createBindings(new IJavaElement[] {
                                                                                         overridden
                                                                                       },              null);
                        if (bindings.length == 1 && bindings[0] instanceof IMethodBinding) {
                                return getParameterTypeNamesForSeeTag((IMethodBinding) bindings[0]);
                        }
                } catch (IllegalStateException e) {
                        // method does not exist
                  }
                // fall back code. Not good for generic methods!
                String[] paramTypes = overridden.getParameterTypes();
                String[] paramTypeNames = new String[paramTypes.length];
                for (int i = 0; i < paramTypes.length; i++) {
                        paramTypeNames[i] = Signature.toString(Signature.getTypeErasure(paramTypes[i]));
                }
                return paramTypeNames;
        }


Clone Instance
2
Line Count
18
Source Line
281
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java

        /*
         * Returns the parameters type names used in see tags. Currently, these are always fully qualified.
         */
        private static String[] getParameterTypeNamesForSeeTag(IMethod overridden) {
                try {
                        ASTParser parser = ASTParser.newParser(AST.JLS3);
                        parser.setProject(overridden.getJavaProject());
                        IBinding[] bindings = parser.createBindings(new IJavaElement[] {
                                                                                         overridden
                                                                                       },              null);
                        if (bindings.length == 1 && bindings[0] instanceof IMethodBinding) {
                                return getParameterTypeNamesForSeeTag((IMethodBinding) bindings[0]);
                        }
                } catch (IllegalStateException e) {
                        // method does not exist
                  }
                // fall back code. Not good for generic methods!
                String[] paramTypes = overridden.getParameterTypes();
                String[] paramTypeNames = new String[paramTypes.length];
                for (int i = 0; i < paramTypes.length; i++) {
                        paramTypeNames[i] = Signature.toString(Signature.getTypeErasure(paramTypes[i]));
                }
                return paramTypeNames;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

 [[#variableb19ec6e0]]static String[] getParameterTypeNamesForSeeTag(IMethod overridden) {
  try {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setProject(overridden.getJavaProject());
    IBinding[] bindings = parser.createBindings(new IJavaElement[] {
                                                                     overridden
                                                                   }, null);
    if (bindings.length == 1 && bindings[0] instanceof IMethodBinding) {
      return getParameterTypeNamesForSeeTag((IMethodBinding) bindings[0]);
    }
  }
  catch (IllegalStateException e) {
  // method does not exist
  }
  // fall back code. Not good for generic methods!
  String[] paramTypes = overridden.getParameterTypes();
  String[] paramTypeNames = new String[paramTypes.length];
  for (int i = 0; i < paramTypes.length; i++) {
    paramTypeNames[i] = Signature.toString(Signature.getTypeErasure(paramTypes[i]));
  }
  return paramTypeNames;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b19ec6e0]]
public 
12[[#b19ec6e0]]
/*
 * Returns the parameters type names used in see tags. Currently, these are always fully qualified.
 */
private