CloneSet331


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
43210.998class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
143316
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
243369
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
Clone Instance
1
Line Count
43
Source Line
316
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java

        /**
         * Finds the method specified by <code>methodName<code> and </code>parameters</code> in
         * the given <code>type</code>. Returns <code>null</code> if no such method exits.
         * @param type The type to search the method in
         * @param methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only 
         *  the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
        public static IMethodBinding findMethodInType(ITypeBinding type, String methodName, ITypeBinding[] parameters) {
                if (type.isPrimitive())
                        return null;
                IMethodBinding[] methods = type.getDeclaredMethods();
                for (int i = 0; i < methods.length; i++) {
                        if (parameters == null) {
                                if (methodName.equals(methods[i].getName()))
                                        return methods[i];
                        }
                        else   {
                                if (isEqualMethod(methods[i], methodName, parameters))
                                        return methods[i];
                        }
                }
                return null;
        }

        /**
         * Finds the method specified by <code>methodName</code> and </code>parameters</code> in
         * the type hierarchy denoted by the given type. 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 methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
        public static IMethodBinding findMethodInHierarchy(ITypeBinding type, String methodName, ITypeBinding[] parameters) {
                IMethodBinding method = findMethodInType(type, methodName, parameters);
                if (method != null)
                        return method;
                ITypeBinding superClass = type.getSuperclass();
                if (superClass != null) {
                        method = findMethodInHierarchy(superClass, methodName, parameters);
                        if (method != null)
                                return method;
                }
                ITypeBinding[] interfaces = type.getInterfaces();
                for (int i = 0; i < interfaces.length; i++) {
                        method = findMethodInHierarchy(interfaces[i], methodName, parameters);
                        if (method != null)
                                return method;
                }
                return null;
        }


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

        /**
         * Finds the method specified by <code>methodName<code> and </code>parameters</code> in
         * the given <code>type</code>. Returns <code>null</code> if no such method exits.
         * @param type The type to search the method in
         * @param methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
        public static IMethodBinding findMethodInType(ITypeBinding type, String methodName, String[] parameters) {
                if (type.isPrimitive())
                        return null;
                IMethodBinding[] methods = type.getDeclaredMethods();
                for (int i = 0; i < methods.length; i++) {
                        if (parameters == null) {
                                if (methodName.equals(methods[i].getName()))
                                        return methods[i];
                        }
                        else   {
                                if (isEqualMethod(methods[i], methodName, parameters))
                                        return methods[i];
                        }
                }
                return null;
        }

        /**
         * Finds the method specified by <code>methodName</code> and </code>parameters</code> in
         * the type hierarchy denoted by the given type. 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 methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
        public static IMethodBinding findMethodInHierarchy(ITypeBinding type, String methodName, String[] parameters) {
                IMethodBinding method = findMethodInType(type, methodName, parameters);
                if (method != null)
                        return method;
                ITypeBinding superClass = type.getSuperclass();
                if (superClass != null) {
                        method = findMethodInHierarchy(superClass, methodName, parameters);
                        if (method != null)
                                return method;
                }
                ITypeBinding[] interfaces = type.getInterfaces();
                for (int i = 0; i < interfaces.length; i++) {
                        method = findMethodInHierarchy(interfaces[i], methodName, parameters);
                        if (method != null)
                                return method;
                }
                return null;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Finds the method specified by <code>methodName<code> and </code>parameters</code> in
         * the given <code>type</code>. Returns <code>null</code> if no such method exits.
         * @param type The type to search the method in
         * @param methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
/**
         * Finds the method specified by <code>methodName<code> and </code>parameters</code> in
         * the given <code>type</code>. Returns <code>null</code> if no such method exits.
         * @param type The type to search the method in
         * @param methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only 
         *  the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
public static IMethodBinding findMethodInType(ITypeBinding type, String methodName, [[#variable5aca0a60]][] parameters) {
  if (type.isPrimitive())
    return null;
  IMethodBinding[] methods = type.getDeclaredMethods();
  for (int i = 0; i < methods.length; i++) {
    if (parameters == null) {
      if (methodName.equals(methods[i].getName()))
        return methods[i];
    }
    else {
      if (isEqualMethod(methods[i], methodName, parameters))
        return methods[i];
    }
  }
  return null;
}

/**
         * Finds the method specified by <code>methodName</code> and </code>parameters</code> in
         * the type hierarchy denoted by the given type. 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 methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
/**
         * Finds the method specified by <code>methodName</code> and </code>parameters</code> in
         * the type hierarchy denoted by the given type. 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 methodName The name of the method to find
         * @param parameters The parameter types of the method to find. If <code>null</code> is passed, only the name is matched and parameters are ignored.
         * @return the method binding representing the method
         */
public static IMethodBinding findMethodInHierarchy(ITypeBinding type, String methodName, [[#variable5aca0a60]][] parameters) {
  IMethodBinding method = findMethodInType(type, methodName, parameters);
  if (method != null)
    return method;
  ITypeBinding superClass = type.getSuperclass();
  if (superClass != null) {
    method = findMethodInHierarchy(superClass, methodName, parameters);
    if (method != null)
      return method;
  }
  ITypeBinding[] interfaces = type.getInterfaces();
  for (int i = 0; i < interfaces.length; i++) {
    method = findMethodInHierarchy(interfaces[i], methodName, parameters);
    if (method != null)
      return method;
  }
  return null;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#5aca0a60]]
String 
12[[#5aca0a60]]
ITypeBinding