Skip to content

Commit 6f30f77

Browse files
committed
Remove public + static from class definitions in interfaces
1 parent 9e7e264 commit 6f30f77

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/org/jetbrains/java/decompiler/main/ClassWriter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,15 @@ private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent)
641641
}
642642
}
643643

644+
// Classes defined inside of interfaces are implicitly public/static (JLS 9.5 Member Type Declarations)
645+
if (
646+
node.type == ClassNode.Type.MEMBER &&
647+
(node.parent.getWrapper().getClassStruct().getAccessFlags() & CodeConstants.ACC_INTERFACE) != 0
648+
) {
649+
flags &= ~CodeConstants.ACC_PUBLIC;
650+
flags &= ~CodeConstants.ACC_STATIC;
651+
}
652+
644653
if (interceptor != null) {
645654
String oldName = interceptor.getOldName(cl.qualifiedName);
646655
appendRenameComment(buffer, oldName, MType.CLASS, indent);

0 commit comments

Comments
 (0)