In IntelliJ IDEA 2017.2.6 I have the following Java class.
public class EinzUnregisterResponseMessageBody extends EinzMessageBody { private final String username, reason; public EinzUnregisterResponseMessageBody(String username, String reason){ this.username = username; this.reason = reason; } @Override public JSONObject toJSON() throws JSONException { return new JSONObject("{\"username\":\""+this.username+"\"," + "\"reason\":\""+this.reason+"\"}"); } public String getReason() { return reason; } public String getUsername() { return username; } }
IntelliJ typically displays unused properties in light gray. In this class, it only stands out getReason() . It makes sense that it does not sed constructor or fields. The toJSON() method is defined in the abstract superclass EinzMessageBody and therefore must exist, therefore it is correct that this was also not EinzMessageBody out. getReason() never used and thus inactive. But why is getUsername() not greyed out? When I right-click it and select "Search", IntelliJ reports that no usages were found.
I know this question , but run Analyze> Inspect Code and Analyze> Run Inspection By Name> Unused properties do not seem to affect this. Does not restart the IDE.
Invalid caches and reboots first reset the display so that nothing is crossed out, but as soon as it finishes indexing, the backlight will be the same again.
Here, as it is displayed in IntelliJ 
The superclass EinzMessageBody specifies only toJSON() and neither getReason() nor getUsername() .
What is the difference between getReason() and getUsername() ?
Regarding the comment by @HonzaZidek:
Removing extends EinzMessageBody and extends EinzMessageBody annotations @Override n't change anything.
Create a completely empty project and insert only this class, and EinzMessageBody makes everything gray except for the toJSON() method. This is as expected, because now I am not creating an instance of the class, so the constructor is grayed out and both getReason() and getUsername() behave the same (both are grayed out).
This still behaves as expected when I move classes to different subpackages, for example, they are in my actual project setup.
This still behaves as expected when I instantiate the class: the constructor is no longer gray, getReason() and getBody() are still gray.
I just put on my laptop (unlike a desktop PC), and the same behavior happens there.
I also looked for any use of getUsername() in other subclasses of EinzMessageBody and found it. Removing this parameter did not change the value of getUsername() in EinzUnregisterResponseMessageBody to be gray.
This answer suggests running Analyze> Run Inspection By Name> Unused Declaration, because IntelliJ cannot validate commonly used names for performance reasons. This displays both getReason() and getUsername() as unused, but the display style remains the same.