Java Spring@Configurable创建具有额外if的代码;findBugs插件考虑了错误

Java Spring@Configurable创建具有额外if的代码;findBugs插件考虑了错误,java,spring,spring-mvc,autowired,Java,Spring,Spring Mvc,Autowired,我需要自动连接一个类成员,我遵循:http://stackoverflow.com/questions/19896870/why-is-my-spring-autowired-field-null @这是我需要的东西,而且效果很好 以下是编译后生成的*.class的构造函数片段: public HelloWorldClient() { JoinPoint localJoinPoint2 = Factory.makeJP(ajc$tjp_1, this, this);

我需要自动连接一个类成员,我遵循:
http://stackoverflow.com/questions/19896870/why-is-my-spring-autowired-field-null

@这是我需要的东西,而且效果很好

以下是编译后生成的*.class的构造函数片段:

public HelloWorldClient() {
        JoinPoint localJoinPoint2 = Factory.makeJP(ajc$tjp_1, this, this);
        JoinPoint localJoinPoint1 = Factory.makeJP(ajc$tjp_0, this, this);


        if ((this != null) && (getClass().isAnnotationPresent(Configurable.class))
            && (AnnotationBeanConfigurerAspect.ajc$if$bb0((Configurable) getClass().getAnnotation(Configurable.class))))
            AnnotationBeanConfigurerAspect
                .aspectOf()
                .ajc$before$org_springframework_beans_factory_aspectj_AbstractDependencyInjectionAspect$1$e854fa65(this);


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


        if ((!AnnotationBeanConfigurerAspect.ajc$if$bb0((Configurable) getClass().getAnnotation(Configurable.class)))
            && (AbstractDependencyInjectionAspect.ajc$if$6f1(localJoinPoint2)))
            AnnotationBeanConfigurerAspect
                .aspectOf()
                .ajc$afterReturning$org_springframework_beans_factory_aspectj_AbstractDependencyInjectionAspect$2$1ea6722c(
                    this);
    }
我在项目中也有findBugs插件,它说

此项的冗余nullcheck,在新版本中为非null packageName.ClassName


此错误指向没有任何代码行的构造函数。我希望findBug指向生成的字节码的行
if((this!=null)
。有什么解决方法吗?

将FindBugs配置为不标记它?与任何可能的替代方案相比,这是迄今为止最快和最简单的解决方法。我更关注的是如何不生成额外的,如果一开始我肯定是,但我提供了最快的方法。您当然可以找到负责生成的代码修改字节码,然后自己修复。别忘了将修复程序发送给spring开发人员,以便他们可以将其合并到未来的版本中。让FindBugs检查生成的代码不是很有用。