Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Bug? Unused field warning disappears when annotations used.(Warning for unused fields disappear if the field has an annotation.)
Bug? Unused field warning disappears when annotations used. [message #1820922] Fri, 31 January 2020 15:11 Go to next message
Eclipse UserFriend
If a class definition contains an unused field, the Eclipse IDE displays a warning icon in the border:

https://1drv.ms/u/s!Aln8SgBjSZM-gbUcn7qOGUkx7m1vYQ?e=1QwyEg

But if an annotation is specified, the warning goes away, even though the field is still not used.

https://1drv.ms/u/s!Aln8SgBjSZM-gbUbPOjdmhvzPDDUDQ?e=JccBcW

Is this a bug?
Re: Bug? Unused field warning disappears when annotations used. [message #1820925 is a reply to message #1820922] Fri, 31 January 2020 21:03 Go to previous message
Eclipse UserFriend
I'll assume this is a Hibernate @Type annotation? The following is speculation on my part. This annotation is marked as having RUNTIME retention, meaning that it is written out to the class file and available for querying using reflection at runtime. As such, the field may be accessed, even if there isn't a direct reference within the class.

Brian.
Previous Topic:How to get Package Explorer to indicate when a Java source files (.java) contains a deprecated class
Next Topic:Git clone produces a non-wildcard fetch refspec since 2019-12
Goto Forum:
  


Current Time: Tue Mar 25 05:58:37 EDT 2025

Powered by FUDForum. Page generated in 0.03570 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top