Browse Source

[WIP] Skip member evaluation if class should not be loaded in the first place

Reason behind this is to prevent NoClassDefFoundErrors for working with Sided classes in MCF
kindlich 4 years ago
parent
commit
5a9962b07a
No known key found for this signature in database

+ 4
- 1
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java View File

194
 	}
194
 	}
195
 	
195
 	
196
 	private boolean isInBasePackage(String className) {
196
 	private boolean isInBasePackage(String className) {
197
-		return className.startsWith(basePackage + ".");
197
+		return className.startsWith(basePackage + ".") || className.startsWith("java.lang.") || className.startsWith("java.util.");
198
 	}
198
 	}
199
 
199
 
200
 	private ZSPackage getPackage(String className) {
200
 	private ZSPackage getPackage(String className) {
303
 
303
 
304
 		//Moved up here so that circular dependencies are caught (hopefully)
304
 		//Moved up here so that circular dependencies are caught (hopefully)
305
 		definitionByClass.put(cls, definition);
305
 		definitionByClass.put(cls, definition);
306
+		if(!shouldLoadClass(cls)) {
307
+			return definition;
308
+		}
306
 
309
 
307
 		//TypeVariableContext context = new TypeVariableContext();
310
 		//TypeVariableContext context = new TypeVariableContext();
308
 		TypeVariable<Class<T>>[] javaTypeParameters = cls.getTypeParameters();
311
 		TypeVariable<Class<T>>[] javaTypeParameters = cls.getTypeParameters();

Loading…
Cancel
Save