Skip to content

The annotation attribute cannot be resolved when nullable annotation analysis is enabled #2743

@testforstephen

Description

@testforstephen

Originally posted by @ChrisVesters in microsoft/vscode-java-debug#1230

[provide a description of the issue]

Environment
  • Operating System: Windows 10
  • JDK version: 17.0.4.1
  • Visual Studio Code version: 1.71.2
  • Java extension version: v1.11.0 (language support extension)
  • Java Debugger extension version: v0.44.0
Steps To Reproduce
  1. Open the attached project.

Screenshot 2022-10-06 083906 test.zip

Current Result

You see there is a compile error as shown in the screenshot.

Expected Result

The value is recognized as a consant expression and simply works.

Additional Informations

The problem is that the compiler somehow does not identify the CTL_ENDPOINT to be a contant value. If the superclass does not use generics this works, so the generics make determination wrong. This would make sense if the ENDPOINT in the superclass would somehow use information from the generic type T, but that is not the case.

Note: I believe this actually used to work in the past as well, so maybe some update must have broken this.

When compile with maven, everything works fine. Also tried this code in IntelliJ, and there it works as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions