forked from JavaTX/JavaCompilerCore
Ignore annotations in STG, fix #288
This commit is contained in:
parent
83ae05ea4a
commit
2cb84f9e2b
8
resources/bytecode/javFiles/Annotation.jav
Normal file
8
resources/bytecode/javFiles/Annotation.jav
Normal file
@ -0,0 +1,8 @@
|
||||
class Base {
|
||||
public void foo() {}
|
||||
}
|
||||
|
||||
public class Annotation extends Base {
|
||||
@Override
|
||||
public void foo() {}
|
||||
}
|
@ -294,6 +294,8 @@ public class SyntaxTreeGenerator {
|
||||
member = (MemberdeclContext) classBody;
|
||||
Integer membermodifiers = 0;
|
||||
for (ModifierContext mod : member.modifier()) {
|
||||
if (mod.classOrInterfaceModifier() != null && mod.classOrInterfaceModifier().annotation() != null)
|
||||
continue; // TODO don't eat annotations
|
||||
membermodifiers += allmodifiers.get(mod.getText());
|
||||
}
|
||||
switch (member.memberDeclaration()) {
|
||||
|
@ -874,6 +874,13 @@ public class TestComplete {
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnnotation() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Annotation.jav");
|
||||
var clazz = classFiles.get("Annotation");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug122() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug122.jav");
|
||||
|
Loading…
Reference in New Issue
Block a user