Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 20:11 Go to next message
Michael Mast is currently offline Michael MastFriend
Messages: 5
Registered: September 2014
Junior Member
If a class definition contains an unused field, the Eclipse IDE displays a warning icon in the border:!Aln8SgBjSZM-gbUcn7qOGUkx7m1vYQ?e=1QwyEg

But if an annotation is specified, the warning goes away, even though the field is still not used.!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] Sat, 01 February 2020 02:03 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

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.

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: Wed Oct 20 21:24:14 GMT 2021

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

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

Back to the top