eclipse-aspectj / aspectj

Other
304 stars 86 forks source link

findbugs-maven-plugin:3.0.5:check failed #152

Closed KinaZhen closed 2 years ago

KinaZhen commented 2 years ago

Redundant nullcheck of this, which is known to be non-null : RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

aspectj weaver code :

if ((this == null || !this.getClass().isAnnotationPresent(Configurable.class) || !AnnotationBeanConfigurerAspect.ajc$if$bb0((Configurable)this.getClass().getAnnotation(Configurable.class))) && this != null && this.getClass().isAnnotationPresent(Configurable.class) && AbstractDependencyInjectionAspect.ajc$if$6f1(var2)) {
  AnnotationBeanConfigurerAspect.aspectOf().ajc$afterReturning$org_springframework_beans_factory_aspectj_AbstractDependencyInjectionAspect$2$1ea6722c(this);
}

how to fix it?

kriegaex commented 2 years ago

What are you talking about? Please explain, like this I don't even understand what you are trying to ask. And if you have a problem, where is your reproducible example?

kriegaex commented 2 years ago

No feedback → closing issue. Feel free to comment and explain why you think this is an AspectJ issue, then we can re-open it.

By the way: If you are talking about the Spring Framework's AnnotationBeanConfigurerAspect, it does not belong to AspectJ. Of course, using it could in theory still trigger an AspectJ weaver bug, but that aspect has been in Spring since 2.0, so if you want me to investigate, please give me a good reason and more information.

If this was just about something Findbugs reported when inspecting your byte code, I think you do not need to worry, because aspect weaving generates byte code which in some corner cases might end up checking something which is always true or always false, but better safe than sorry.