Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b882e9

Browse files
author
sebastigurin
committed
1 parent a186445 commit 6b882e9

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/net/sf/j2s/core/astvisitors/DependencyASTVisitor.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -956,18 +956,20 @@ public boolean visit(MethodInvocation node) {
956956
optionals.add(qn);
957957
}
958958
}
959-
960-
//the ofllowing fix introduces an error... reverting fix until a solution is found
961-
//sgurin: fix for bug http://sourceforge.net/tracker/?func=detail&aid=3037341&group_id=155436&atid=795800
962-
//in a static method call, if the mehthod's type is not this class, we require it.
963-
// String methodOwnerClassName = resolveMethodBinding.getDeclaringClass().getQualifiedName();
964-
// if(methodOwnerClassName!=null && !methodOwnerClassName.equals(Bindings.getBindingOfParentType(node).getQualifiedName())) {
965-
// requires.add(methodOwnerClassName);
966-
// }
959+
//sgurin bugfix for http://sourceforge.net/tracker/?func=detail&aid=3037341&group_id=155436&atid=795800
960+
else if(expression == null) { //statically imported method invocation
961+
QNTypeBinding qn = new QNTypeBinding();
962+
String qualifiedName = resolveMethodBinding.getDeclaringClass().getQualifiedName();
963+
if(qualifiedName != null && isQualifiedNameOK(qualifiedName, node)) {
964+
qn.qualifiedName = qualifiedName;
965+
if(!musts.contains(qn) && !requires.contains(qn)) {
966+
optionals.add(qn);
967+
}
968+
}
969+
}
967970
}
968971
return super.visit(node);
969972
}
970-
971973
public boolean isDebugging() {
972974
return isDebugging;
973975
}

0 commit comments

Comments
 (0)