Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified sources/net.sf.j2s.core/dist/dropins/net.sf.j2s.core.jar
Binary file not shown.
Binary file modified sources/net.sf.j2s.core/dist/net.sf.j2s.core_3.1.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3941,7 +3941,6 @@ private String getMethodNameOrArrayForDeclaration(MethodDeclaration node, IMetho
// System.err.println("checking methodList for " + nodeName.toString() +
// " in " + methodClass.getKey());
List<String[]> methodList = getGenericMethodList(methodClass, nodeName.toString());

if (methodList != null) {
// System.err.println("have methodList for " + nodeName + " " +
// methodList.size());
Expand All @@ -3955,7 +3954,7 @@ private String getMethodNameOrArrayForDeclaration(MethodDeclaration node, IMetho
if (pname != null)
names.add(pname);
}
} else if (addUnqualified && !methodName.equals(qname)) {
} else if (addUnqualified && !methodName.equals(qname) && !classHasMethod(methodClass, methodName)) {
names = new ArrayList<String>();
names.add(methodName);
}
Expand All @@ -3970,6 +3969,20 @@ private String getMethodNameOrArrayForDeclaration(MethodDeclaration node, IMetho
return "[" + qname.substring(1) + "]";
}

private static boolean classHasMethod(ITypeBinding methodClass, String methodName) {
while (methodClass != null) {
IMethodBinding[] methods = methodClass.getDeclaredMethods();
for (int i = methods.length; --i >= 0;) {
IMethodBinding m = methods[i];
if (m.getName().equals(methodName) && m.getParameterTypes().length == 0
&& !Modifier.isPrivate(m.getModifiers()))
return true;
}
methodClass = methodClass.getSuperclass();
}
return false;
}

/**
* Determine the qualified parameter suffix for method names, including
* constructors.
Expand Down