Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Eclipse4/DI/Problems"

 
Line 1: Line 1:
 +
{| cellspacing="0" cellpadding="5" style="border:1px solid red;"
 +
|-
 +
! The compiler bugs described below are already fixed, so these setting changes are no longer required.
 +
|}
 +
 
Due to [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365455 365455] and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365437 365437] you can run into problems when attempting to inject into private methods if you have certain Optional Error compiler preferences set.
 
Due to [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365455 365455] and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365437 365437] you can run into problems when attempting to inject into private methods if you have certain Optional Error compiler preferences set.
  
Line 6: Line 11:
 
* Make sure "Suppress optional errors with '@SuppressWarnings'" '''IS''' checked.
 
* Make sure "Suppress optional errors with '@SuppressWarnings'" '''IS''' checked.
 
* Add a @SuppressWarnings("unused") annotation to each private @Injected method you declare
 
* Add a @SuppressWarnings("unused") annotation to each private @Injected method you declare
 
When (if) both compiler bugs are fixed, none of these setting changes will be required, and private methods annotated with @Inject will not require a separate SuppressWarnings annotation.
 
  
 
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)
 
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)

Latest revision as of 05:14, 17 June 2014

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)

Back to the top