Skip to content

Java 16: Support and correctly handle relaxed static member rules and local interfaces, enums and records #5564

@Marcono1234

Description

@Marcono1234

(These are new Java 16 feature so I can understand if you defer support for this to a later point.)
Blocked by #4281

Java 16 has the following two language changes which probably require adjustments in the extractor and in the CodeQL libraries and queries:

  • As part of JEP 395 local enum and record classes and interfaces were allowed. The most important change here are probably local interfaces (since enums and records are likely covered by CodeQL's LocalCass).
    This requires changes to how Java is modelled because currently there is only a LocalClass and the predicate isLocal() only exists for Class. Similarly existing queries which only check for LocalClass would need to be updated to check for LocalInterface as well (respectively isLocal() should be moved to RefType and that predicate should then be used).
  • The rules for static members were relaxed, see JDK-825432 (currently not mentioned explicitly in the release notes). This allows declaring static members in non-static enclosing types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    JavaacknowledgedGitHub staff acknowledges this issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions