ソースを参照

[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
この署名に対応する既知のキーがデータベースに存在しません

+ 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();

読み込み中…
キャンセル
保存