We use reflection extensively to set class field values in our code. The fields are accessed in code but they are never assigned except via reflection. So IDEA displays "is never assigned" warning. If I ask IDEA to suppress the inspection, it inserts
You could use an annotation to mark it as an injected field. (similar to how it would treat
@EJB). The IntelliJ inspections (at least with version 10.5) allow you to configure your own annotations to mark fields as being injected.
Select Analyze, Inspect Code from the menu and then go to the unused declaration inspection and you can configure an annotation.