瀏覽代碼

[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 5 年之前
父節點
當前提交
5a9962b07a
沒有發現已知的金鑰在資料庫的簽署中
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java

+ 4
- 1
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java 查看文件

@@ -194,7 +194,7 @@ public class JavaNativeModule {
194 194
 	}
195 195
 	
196 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 200
 	private ZSPackage getPackage(String className) {
@@ -303,6 +303,9 @@ public class JavaNativeModule {
303 303
 
304 304
 		//Moved up here so that circular dependencies are caught (hopefully)
305 305
 		definitionByClass.put(cls, definition);
306
+		if(!shouldLoadClass(cls)) {
307
+			return definition;
308
+		}
306 309
 
307 310
 		//TypeVariableContext context = new TypeVariableContext();
308 311
 		TypeVariable<Class<T>>[] javaTypeParameters = cls.getTypeParameters();

Loading…
取消
儲存