X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java index de16099..0e9eab3 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java @@ -195,14 +195,14 @@ public class JavaModelUtil { * the member (eg. from the original) * @return the member found, or null if not existing */ - public static IMember findMemberInCompilationUnit(ICompilationUnit cu, - IMember member) throws JavaModelException { - IJavaElement[] elements = cu.findElements(member); - if (elements != null && elements.length > 0) { - return (IMember) elements[0]; - } - return null; - } +// public static IMember findMemberInCompilationUnit(ICompilationUnit cu, +// IMember member) throws JavaModelException { +// IJavaElement[] elements = cu.findElements(member); +// if (elements != null && elements.length > 0) { +// return (IMember) elements[0]; +// } +// return null; +// } /** * Returns the element of the given compilation unit which is "equal" to the @@ -365,10 +365,10 @@ public class JavaModelUtil { * If the method is a constructor * @return The first found method or null, if nothing found */ - public static IMethod findMethod(String name, String[] paramTypes, - boolean isConstructor, IType type) throws JavaModelException { - return findMethod(name, paramTypes, isConstructor, type.getMethods()); - } +// public static IMethod findMethod(String name, String[] paramTypes, +// boolean isConstructor, IType type) throws JavaModelException { +// return findMethod(name, paramTypes, isConstructor, type.getMethods()); +// } /** * Finds a method by name. This searches for a method with a name and @@ -387,16 +387,16 @@ public class JavaModelUtil { * The methods to search in * @return The found method or null, if nothing found */ - public static IMethod findMethod(String name, String[] paramTypes, - boolean isConstructor, IMethod[] methods) throws JavaModelException { - for (int i = methods.length - 1; i >= 0; i--) { - if (isSameMethodSignature(name, paramTypes, isConstructor, - methods[i])) { - return methods[i]; - } - } - return null; - } +// public static IMethod findMethod(String name, String[] paramTypes, +// boolean isConstructor, IMethod[] methods) throws JavaModelException { +// for (int i = methods.length - 1; i >= 0; i--) { +// if (isSameMethodSignature(name, paramTypes, isConstructor, +// methods[i])) { +// return methods[i]; +// } +// } +// return null; +// } /** * Finds a method declararion in a type's hierarchy. The search is top down, @@ -487,28 +487,28 @@ public class JavaModelUtil { * @return Returns true if the method has the given name and * parameter types and constructor state. */ - public static boolean isSameMethodSignature(String name, - String[] paramTypes, boolean isConstructor, IMethod curr) - throws JavaModelException { - if (isConstructor || name.equals(curr.getElementName())) { - if (isConstructor == curr.isConstructor()) { - String[] currParamTypes = curr.getParameterTypes(); - if (paramTypes.length == currParamTypes.length) { - for (int i = 0; i < paramTypes.length; i++) { - String t1 = Signature.getSimpleName(Signature - .toString(paramTypes[i])); - String t2 = Signature.getSimpleName(Signature - .toString(currParamTypes[i])); - if (!t1.equals(t2)) { - return false; - } - } - return true; - } - } - } - return false; - } +// public static boolean isSameMethodSignature(String name, +// String[] paramTypes, boolean isConstructor, IMethod curr) +// throws JavaModelException { +// if (isConstructor || name.equals(curr.getElementName())) { +// if (isConstructor == curr.isConstructor()) { +// String[] currParamTypes = curr.getParameterTypes(); +// if (paramTypes.length == currParamTypes.length) { +// for (int i = 0; i < paramTypes.length; i++) { +// String t1 = Signature.getSimpleName(Signature +// .toString(paramTypes[i])); +// String t2 = Signature.getSimpleName(Signature +// .toString(currParamTypes[i])); +// if (!t1.equals(t2)) { +// return false; +// } +// } +// return true; +// } +// } +// } +// return false; +// } /** * Checks whether the given type has a valid main method or not.