False positive for java 21 switch case with null, default
还没有人认领这个 Issue。
评估
调研方向
使用最小的 Java 21 switch 示例和所引用的 PrintixService.java 案例,重现 CodeQL Java 提取失败。首先跟踪 Java extractor 对涉及 null 和 default 的 switch 标签的解析。完成标准是:有效的 Java 21 源代码能够成功提取,并且 finalization 能够在没有报告的错误的情况下处理 Java 代码。
由索引模型根据 Issue 内容生成。
描述
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
static String f(Object x) {
return switch (x) {
case null, default -> "v";
};
}
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 134
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/codeql 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
false-positive
难度 2/5 1-3 小时 新手友好度 70/100
-
false-positive
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
todo:perf
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 86/100
objectionary/eo#8894 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
objectionary/phie#154 ·
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
objectionary/jeo-maven-plugin#1774 ·
-
Minor breakage w/ LLVM 7: `test_llvm.cpp: error: cannot convert 'llvm::Module' to 'llvm::Module*'` 未关闭
难度 2/5 1-3 小时 新手友好度 68/100