@Component
@Setter
public class MyBeautifulClass {
// next line is present several time to set all variables
private static final String A_VARIABLE = "A text";
@Resource
private LanguageToLocaleConverter languageToLocaleConverter; // pb line
public String myFunction() {
// logic
}
}
The code smell is raised on the line already decorated with @Resource. Asking me to annotate it with a decorators, among which there is @Resource. Here is the full text : Annotate this member with "@Autowired", "@Resource", "@Inject", or "@Value", or remove it.
Is there a workaround for this issue, I saw the error reported fiew years ago but not clear answer on this.
Can you check in your SonarQube IDE configuration if you have the issue enabled?
Could you guess which is the difference from your global report in your project and your own configuration ? It’s weird that you and me can not reproduce it but your company SQ is detecting it.
I did not managed to reproduce it since…
I don’t know from where it can come. I’ll let you know if it appends again but in the interval I don’t see what we can do on this one.