You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dynamicjava/src/koala/dynamicjava/util/ImportationManager.java
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -303,13 +303,16 @@ public void declareMemberStaticImport(String member) {
303
303
//Different methods require different formats, and having both can't hurt anything. Any of the methods that use the list of classes try and catch through the
304
304
//list until they come across a class that fits
305
305
try {
306
+
Classc;
306
307
try {
307
-
Class.forName(member, true, classLoader);
308
+
c = Class.forName(member, true, classLoader);
308
309
} catch (ClassNotFoundExceptioncnfe) {
309
-
findInnerClass(member);
310
+
c = findInnerClass(member);
311
+
}
312
+
if(isPublicAndStatic(c.getModifiers())) {
313
+
declareClassImport(member);
314
+
foundSomethingToImport = true;
310
315
}
311
-
declareClassImport(member);
312
-
foundSomethingToImport = true;
313
316
}
314
317
catch(ClassNotFoundExceptione) {
315
318
}
@@ -323,9 +326,11 @@ public void declareMemberStaticImport(String member) {
323
326
//Next, check for all static fields
324
327
try {
325
328
Fieldf = surroundingClass.getField(name);
326
-
singleTypeImportStaticFieldClauses.remove(f);
327
-
singleTypeImportStaticFieldClauses.add(0,f);
328
-
foundSomethingToImport = true;
329
+
if(isPublicAndStatic(f.getModifiers())) {
330
+
singleTypeImportStaticFieldClauses.remove(f);
331
+
singleTypeImportStaticFieldClauses.add(0,f);
332
+
foundSomethingToImport = true;
333
+
}
329
334
}
330
335
catch(NoSuchFieldExceptione) {
331
336
}
@@ -339,9 +344,11 @@ public void declareMemberStaticImport(String member) {
0 commit comments