github / github/codeql

False positive for java 21 switch case with null, default

Offen
#22,040 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
false-positive Stale
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

### 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";
};
}

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
compilers
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.