|
@@ -73,7 +73,7 @@ public class JavaPrepareDefinitionVisitor implements DefinitionVisitor<JavaClass
|
73
|
73
|
JavaNativeClass list = new JavaNativeClass(new JavaClass("java.util", "List", JavaClass.Kind.INTERFACE));
|
74
|
74
|
JavaClass arrayList = new JavaClass("java.util", "ArrayList", JavaClass.Kind.CLASS);
|
75
|
75
|
list.addMethod("constructor", JavaMethod.getNativeConstructor(arrayList, "()V"));
|
76
|
|
- list.addInstanceMethod("add", "add", "(Ljava/lang/Object;)Z"); List<?> l;
|
|
76
|
+ list.addInstanceMethod("add", "add", "(Ljava/lang/Object;)Z");
|
77
|
77
|
list.addInstanceMethod("insert", "add", "(Ljava/lang/Object;I)V");
|
78
|
78
|
list.addInstanceMethod("remove", "remove", "(Ljava/lang/Object;)Z");
|
79
|
79
|
list.addInstanceMethod("indexOf", "indexOf", "(Ljava/lang/Object;)I");
|
|
@@ -236,14 +236,20 @@ public class JavaPrepareDefinitionVisitor implements DefinitionVisitor<JavaClass
|
236
|
236
|
|
237
|
237
|
private final JavaContext context;
|
238
|
238
|
private final String filename;
|
|
239
|
+ private final String className;
|
239
|
240
|
private final JavaClass outerClass;
|
240
|
241
|
private final JavaCompiledModule module;
|
241
|
|
-
|
|
242
|
+
|
242
|
243
|
public JavaPrepareDefinitionVisitor(JavaContext context, JavaCompiledModule module, String filename, JavaClass outerClass) {
|
|
244
|
+ this(context, module, filename, outerClass, JavaClass.getNameFromFile(filename));
|
|
245
|
+ }
|
|
246
|
+
|
|
247
|
+ public JavaPrepareDefinitionVisitor(JavaContext context, JavaCompiledModule module, String filename, JavaClass outerClass, String className) {
|
243
|
248
|
this.context = context;
|
244
|
249
|
this.filename = filename;
|
245
|
250
|
this.outerClass = outerClass;
|
246
|
251
|
this.module = module;
|
|
252
|
+ this.className = className;
|
247
|
253
|
}
|
248
|
254
|
|
249
|
255
|
private boolean isPrepared(HighLevelDefinition definition) {
|
|
@@ -298,7 +304,7 @@ public class JavaPrepareDefinitionVisitor implements DefinitionVisitor<JavaClass
|
298
|
304
|
if (isPrepared(definition))
|
299
|
305
|
return context.getJavaClass(definition);
|
300
|
306
|
|
301
|
|
- JavaClass cls = new JavaClass(context.getPackageName(definition.pkg), JavaClass.getNameFromFile(filename), JavaClass.Kind.CLASS);
|
|
307
|
+ JavaClass cls = new JavaClass(context.getPackageName(definition.pkg), className, JavaClass.Kind.CLASS);
|
302
|
308
|
context.setJavaClass(definition, cls);
|
303
|
309
|
return cls;
|
304
|
310
|
}
|
|
@@ -313,7 +319,7 @@ public class JavaPrepareDefinitionVisitor implements DefinitionVisitor<JavaClass
|
313
|
319
|
context.setJavaNativeClass(definition, nativeClasses.get(nativeTag.value));
|
314
|
320
|
}
|
315
|
321
|
|
316
|
|
- JavaClass cls = new JavaClass(context.getPackageName(definition.pkg), JavaClass.getNameFromFile(filename), JavaClass.Kind.CLASS);
|
|
322
|
+ JavaClass cls = new JavaClass(context.getPackageName(definition.pkg), className, JavaClass.Kind.CLASS);
|
317
|
323
|
context.setJavaClass(definition, cls);
|
318
|
324
|
return cls;
|
319
|
325
|
}
|