Skip to content

Compiler error with Java 21 #73

@cushon

Description

@cushon

Describe the bug

The project fails to compile at the Java 21 language level.

Reproduction

JAVA_HOME=<path to JDK 21> mvn install

Logs

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile (default-compile) on project named-regexp: Compilation failure: Compilation failure:
[ERROR] ./named-regexp/src/main/java/com/google/code/regexp/Matcher.java:[314,38] namedGroups() in com.google.code.regexp.Matcher cannot implement namedGroups() in java.util.regex.MatchResult
[ERROR]   return type java.util.List<java.util.Map<java.lang.String,java.lang.String>> is not compatible with java.util.Map<java.lang.String,java.lang.Integer>
[ERROR] .,/named-regexp/src/main/java/com/google/code/regexp/MatchResult.java:[44,38] namedGroups() in com.google.code.regexp.MatchResult clashes with namedGroups() in java.util.regex.MatchResult
[ERROR]   return type java.util.List<java.util.Map<java.lang.String,java.lang.String>> is not compatible with java.util.Map<java.lang.String,java.lang.Integer>

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions