Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Eclipse4/DI/Problems
The compiler bugs described below are already fixed, so these setting changes are no longer required. |
---|
Due to 365455 and 365437 you can run into problems when attempting to inject into private methods if you have certain Optional Error compiler preferences set.
If you have compiler settings (or project specific compiler settings) configured to treat "Unused private members" as "Errors" you will need to make the following adjustments to the compiler settings:
- Make sure "Treat above errors like fatal compiler errors (make compiled code not executable)" IS NOT checked.
- Make sure "Enable '@SuppressWarnings' annotations" IS checked.
- Make sure "Suppress optional errors with '@SuppressWarnings'" IS checked.
- Add a @SuppressWarnings("unused") annotation to each private @Injected method you declare
Feel free to comment on the noted defects if this capability would be useful to you. If you do not wish to do any of the above, you could simply make your handler methods "package private" or protected. (You could even make them public, but I would recommend against it)