JDK-8043226 : Better diagnostics for non-applicable type annotations
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8,9
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-05-15
  • Updated: 2024-06-22
  • Resolved: 2024-06-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 23
23 b26Fixed
Related Reports
Relates :  
Relates :  
Description
Currently the only diagnostic which indicates that a type annotation cannot be applied to a given piece of syntax reads "cannot annotate scoping construct".  This is unclear and in some cases, outright misleading (particularly for annotations on .class expressions).  There ought to be better diagnostics.
Comments
Changeset: 612b6896 Author: Liam Miller-Cushon <cushon@openjdk.org> Date: 2024-06-04 17:18:53 +0000 URL: https://git.openjdk.org/jdk/commit/612b6896d28cebf61ef024709ff3afb5e3ee0dde
04-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16592 Date: 2023-11-10 01:21:28 +0000
10-11-2023