Skip to content

Commit

Permalink
Added support for protected_static visibility in KotlinTypeMapping. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
traceyyoshima authored Nov 13, 2023
1 parent 940cdd4 commit de58a48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,10 @@ class KotlinTypeMapping(
"public" -> bitMask += 1L
"private", "private_to_this" -> bitMask += 1L shl 1
"protected", "protected_and_package" -> bitMask += 1L shl 2
"protected_static" -> {
bitMask += 1L shl 2
bitMask += 1L shl 3 // static
}
"internal", "package", "local" -> {}
else -> throw UnsupportedOperationException("Unsupported visibility: ${visibility.name.lowercase()}")
}
Expand Down
13 changes: 13 additions & 0 deletions src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,19 @@ public J.VariableDeclarations.NamedVariable visitVariable(J.VariableDeclarations
);
}

@Test
void packageStaticModifier() {
rewriteRun(
kotlin(
"""
import java.rmi.server.RemoteStub
class A : RemoteStub()
"""
)
);
}

@Test
void nullJavaClassifierType() {
rewriteRun(
Expand Down

0 comments on commit de58a48

Please sign in to comment.