Suppress "variable is never assigned" warning in IntelliJ IDEA
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.
To configure annotations in Android Studio 1.1.0 after inspecting your code right click Unused declaration -> Edit Settings -> Configure annotations.
- run analysis: Analyze > Inpect Code...
- Right click on Unused Declaration (below the Declaration redundancy tree node)
- Click on the "Configure Annotations..."
- Add com.google.google.inject.Inject and javax.inject.Inject