Commit d4523c4e authored by Skylot's avatar Skylot

core: remove 'static' modifier for inner interfaces

parent 5d894b61
......@@ -119,7 +119,8 @@ public class ClassGen {
public void addClassDeclaration(CodeWriter clsCode) {
AccessInfo af = cls.getAccessFlags();
if (af.isInterface()) {
af = af.remove(AccessFlags.ACC_ABSTRACT);
af = af.remove(AccessFlags.ACC_ABSTRACT)
.remove(AccessFlags.ACC_STATIC);
} else if (af.isEnum()) {
af = af.remove(AccessFlags.ACC_FINAL)
.remove(AccessFlags.ACC_ABSTRACT)
......
......@@ -25,10 +25,9 @@ public class AccessInfo {
public AccessInfo remove(int flag) {
if (containsFlag(flag)) {
return new AccessInfo(accFlags - flag, type);
} else {
return this;
return new AccessInfo(accFlags & ~flag, type);
}
return this;
}
public AccessInfo getVisibility() {
......
......@@ -12,7 +12,7 @@ import static org.junit.Assert.assertThat;
public class TestClassGen extends IntegrationTest {
public static class TestCls {
public static interface I {
public interface I {
int test();
public int test3();
......@@ -28,7 +28,7 @@ public class TestClassGen extends IntegrationTest {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsString("public static interface I {"));
assertThat(code, containsString("public interface I {"));
assertThat(code, containsString(indent(2) + "int test();"));
assertThat(code, not(containsString("public int test();")));
assertThat(code, containsString(indent(2) + "int test3();"));
......
......@@ -19,7 +19,7 @@ public class TestAnnotations2 extends IntegrationTest {
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public static @interface A {
public @interface A {
int i();
float f();
......@@ -33,7 +33,7 @@ public class TestAnnotations2 extends IntegrationTest {
assertThat(code, containsString("@Target({ElementType.TYPE})"));
assertThat(code, containsString("@Retention(RetentionPolicy.RUNTIME)"));
assertThat(code, containsString("public static @interface A {"));
assertThat(code, containsString("public @interface A {"));
assertThat(code, containsString("float f();"));
assertThat(code, containsString("int i();"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment