github / github/codeql

False positive for java 21 switch case with null, default

未关闭
#22,040 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
false-positive Stale
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

### Version
CodeQL CLI: 2.25.6
github/codeql-action: v3
JDK: 21
OS: ubuntu-latest

### What happened?
CodeQL Java extraction fails on valid Java 21 switch syntax.

Error:
- Unable to parse source file: `.../PrintixService.java`
- Parse error at line 84 column 23: Syntax error on token "default", invalid Expression

Then finalize fails with:
- "CodeQL detected code written in Java/Kotlin but could not process any of it."
- exit code 32

### Minimal reproducible example
```java
static String f(Object x) {
return switch (x) {
case null, default -> "v";
};
}

贡献指南

打开贡献指南

调研方向

Reproduce the CodeQL Java extraction failure with the minimal Java 21 switch example and the referenced PrintixService.java case. Start by tracing the Java extractor's parsing of switch labels involving null and default. Done means valid Java 21 source extracts successfully and finalization processes the Java code without the reported errors.

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
compilers
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。