Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

False positive for java 21 switch case with null, default

Open
#22,040 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
compilers

Research direction

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.

Written by the indexing model from the issue text.

Description

false-positive Stale
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";
  };
}
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 16h
Merged PRs (30d)
143

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql

All issues in github/codeql

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.