Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
43 | 2 | 1 | 0.998 | class_body_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 43 | 316 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java |
2 | 43 | 369 | 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; } |
| ||||
/** * 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; } |
| |||
/** * 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#5aca0a60]] | String |
1 | 2 | [[#5aca0a60]] | ITypeBinding |