CloneSet961


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
17260.955class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
117288
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
217438
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
Clone Instance
1
Line Count
17
Source Line
288
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java

        /**
         * Finds the field specified by <code>fieldName</code> in
         * the type hierarchy denoted by the given type. Returns <code>null</code> if no such field
         * exists. If the field is defined in more than one super type only the first match is 
         * returned. First the super class is examined and than the implemented interfaces.
         * @param type The type to search the field in
         * @param fieldName The name of the field to find
         * @return the variable binding representing the field
         */
        public static IVariableBinding findFieldInHierarchy(ITypeBinding type, String fieldName) {
                IVariableBinding field = findFieldInType(type, fieldName);
                if (field != null)
                        return field;
                ITypeBinding superClass = type.getSuperclass();
                if (superClass != null) {
                        field = findFieldInHierarchy(superClass, fieldName);
                        if (field != null)
                                return field;
                }
                ITypeBinding[] interfaces = type.getInterfaces();
                for (int i = 0; i < interfaces.length; i++) {
                        field = findFieldInHierarchy(interfaces[i], fieldName);
                        if (field != null) // no private fields in interfaces
                                return field;
                }
                return null;
        }


Clone Instance
2
Line Count
17
Source Line
438
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java

        /**
         * Finds a method in the hierarchy of <code>type</code> that is overridden by </code>binding</code>.
         * Returns <code>null</code> if no such method exists. If the method is defined in more than one super type only the first match is 
         * returned. First the super class is examined and than the implemented interfaces.
         * @param type The type to search the method in
         * @param binding The method that overrrides
         * @return the method binding overridden the method
         */
        public static IMethodBinding findOverriddenMethodInHierarchy(ITypeBinding type, IMethodBinding binding) {
                IMethodBinding method = findOverriddenMethodInType(type, binding);
                if (method != null)
                        return method;
                ITypeBinding superClass = type.getSuperclass();
                if (superClass != null) {
                        method = findOverriddenMethodInHierarchy(superClass, binding);
                        if (method != null)
                                return method;
                }
                ITypeBinding[] interfaces = type.getInterfaces();
                for (int i = 0; i < interfaces.length; i++) {
                        method = findOverriddenMethodInHierarchy(interfaces[i], binding);
                        if (method != null)
                                return method;
                }
                return null;
        }


Clone AbstractionParameter Count: 6Parameter Bindings

/**
         * Finds the field specified by <code>fieldName</code> in
         * the type hierarchy denoted by the given type. Returns <code>null</code> if no such field
         * exists. If the field is defined in more than one super type only the first match is 
         * returned. First the super class is examined and than the implemented interfaces.
         * @param type The type to search the field in
         * @param fieldName The name of the field to find
         * @return the variable binding representing the field
         */
/**
         * Finds a method in the hierarchy of <code>type</code> that is overridden by </code>binding</code>.
         * Returns <code>null</code> if no such method exists. If the method is defined in more than one super type only the first match is 
         * returned. First the super class is examined and than the implemented interfaces.
         * @param type The type to search the method in
         * @param binding The method that overrrides
         * @return the method binding overridden the method
         */
public static [[#variablec19280c0]]  [[#variablec1928060]](ITypeBinding type, [[#variableb3403f80]]  [[#variableb3403ee0]]) {
   [[#variablec19280c0]]  [[#variableb3403e40]]= [[#variableb3403dc0]](type,  [[#variableb3403ee0]]);
  if ( [[#variableb3403e40]]!= null)
    return [[#variableb3403e40]];
  ITypeBinding superClass = type.getSuperclass();
  if (superClass != null) {
     [[#variableb3403e40]]= [[#variablec1928060]](superClass,  [[#variableb3403ee0]]);
    if ( [[#variableb3403e40]]!= null)
      return [[#variableb3403e40]];
  }
  ITypeBinding[] interfaces = type.getInterfaces();
  for (int i = 0; i < interfaces.length; i++) {
     [[#variableb3403e40]]= [[#variablec1928060]](interfaces[i],  [[#variableb3403ee0]]);
    if ( [[#variableb3403e40]]!= null) // no private fields in interfaces
      return [[#variableb3403e40]];
  }
  return null;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#c19280c0]]
IVariableBinding 
12[[#c19280c0]]
IMethodBinding 
21[[#c1928060]]
findFieldInHierarchy 
22[[#c1928060]]
findOverriddenMethodInHierarchy 
31[[#b3403f80]]
String 
32[[#b3403f80]]
IMethodBinding 
41[[#b3403ee0]]
fieldName 
42[[#b3403ee0]]
binding 
51[[#b3403e40]]
field 
52[[#b3403e40]]
method 
61[[#b3403dc0]]
findFieldInType 
62[[#b3403dc0]]
findOverriddenMethodInType