Skip to content

Commit 6a958f7

Browse files
author
zhourenjian
committed
Fixed bug on "ASWTClass"' class dependency is unnecessary.
Try to ignore some of SimplePipe's methods in compiling SimplePipe classes.
1 parent eac07ab commit 6a958f7

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ protected void checkSuperType(Set set) {
127127

128128

129129
protected void remedyReflectionDependency(Set set) {
130+
String[] classNames = getClassNames();
131+
for (int i = 0; i < classNames.length; i++) {
132+
if ("net.sf.j2s.ajax.ASWTClass".equals(classNames[i])) {
133+
return;
134+
}
135+
}
130136
boolean needRemedy = false;;
131137
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
132138
Object next = iterator.next();
@@ -888,7 +894,32 @@ public void setToCompileVariableName(boolean toCompileVariableName) {
888894

889895
public boolean visit(MethodDeclaration node) {
890896
IMethodBinding mBinding = node.resolveBinding();
897+
boolean toBeIgnored = false;
891898
if (Bindings.isMethodInvoking(mBinding, "net.sf.j2s.ajax.SimpleRPCRunnable", "ajaxRun")) {
899+
toBeIgnored = true;
900+
}
901+
if (!toBeIgnored) {
902+
String[] pipeMethods = new String[] {
903+
"pipeSetup",
904+
"pipeThrough",
905+
"through",
906+
"pipeMonitoring",
907+
"pipeMonitoringInterval",
908+
"setPipeHelper"
909+
};
910+
for (int i = 0; i < pipeMethods.length; i++) {
911+
if (Bindings.isMethodInvoking(mBinding, "net.sf.j2s.ajax.SimplePipeRunnable", pipeMethods[i])) {
912+
toBeIgnored = true;
913+
break;
914+
}
915+
}
916+
}
917+
if (!toBeIgnored) {
918+
if (Bindings.isMethodInvoking(mBinding, "net.sf.j2s.ajax.CompoundPipeSession", "convert")) {
919+
toBeIgnored = true;
920+
}
921+
}
922+
if (toBeIgnored) {
892923
boolean toKeep = false;
893924
Javadoc javadoc = node.getJavadoc();
894925
if (javadoc != null) {

0 commit comments

Comments
 (0)