Skip to content

Commit 973aeda

Browse files
committed
[javasrc2cpg] Parse enums correctly when keepTypeArguments is enabled
Signed-off-by: ricekot <[email protected]>
1 parent c5c8ef5 commit 973aeda

File tree

1 file changed

+11
-0
lines changed
  • joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying

1 file changed

+11
-0
lines changed

joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/VarDeclTests.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ class VarDeclTests extends JavaSrcCode2CpgFixture {
206206
.head shouldBe "org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer.<init>:<unresolvedSignature>(3)"
207207
}
208208

209+
"parse enums correctly" in {
210+
val cpg = code("""
211+
|public enum Color {
212+
| RED,
213+
| GREEN,
214+
| BLUE
215+
|}
216+
|""".stripMargin).withConfig(Config().withKeepTypeArguments(true))
217+
218+
cpg.typeDecl("Color").code.head shouldBe "public enum Color"
219+
}
209220
}
210221

211222
}

0 commit comments

Comments
 (0)