Skip to content

Issue during analysis of SpringCGLIB after Spring Boot Native build #3059

@klopfdreh

Description

@klopfdreh

We are currently testing Spring Boot Native builds and found out that during the analysis SpotBugs failed.

See the following maven_plugin_logs.txt

maven_plugin_logs.txt

Initial lines of error:

[java]   Error analyzing mypackage.steps.prepare.StepS3FilesPrepareExecutionListener$$SpringCGLIB$$0.setCallbacks([Lorg/springframework/cglib/proxy/Callback;)V for unconditional deref training
[java]     edu.umd.cs.findbugs.ba.CFGBuilderException: Invalid stack at    2: dup2[92](1) when checking    8: putfield[181](3) 58

See a minimal example here: https://github.com/klopfdreh/native-cloud-config-test and add spotbugs maven plugin together with a configuration that creates a SpringCGLIB

suppression.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<FindBugsFilter xmlns="https://github.com/spotbugs/filter/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
    <!-- Ignore checking for Spring Boot AOT generated classes -->
    <Match>
        <Or>
            <Class name="~.*\$\$SpringCGLIB\$\$.*"/>
        </Or>
    </Match>
    <Match>
        <Or>
            <Class name="~.*__BeanDefinitions.*"/>
        </Or>
    </Match>
    <Match>
        <Or>
            <Class name="~.*__BeanFactoryRegistrations.*"/>
        </Or>
    </Match>
    <Match>
        <Or>
            <Class name="~.*RetryTemplateFactory.*"/>
        </Or>
    </Match>
    <Match>
        <Or>
            <Class name="~.*DefaultDataSourceConfiguration.*"/>
        </Or>
    </Match>
</FindBugsFilter>

Plugin Configuration

                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.8.5.0</version>
                    <executions>
                        <execution>
                            <id>spotbugs</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>verify</goal>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <xmlOutput>true</xmlOutput>
                        <excludeFilterFile>/mypath/suppression.xml</excludeFilterFile>
                        <effort>Max</effort>
                        <fork>false</fork>
                        <jvmArgs>-Djava.security.manager=allow</jvmArgs>
                        <plugins>
                            <plugin>
                                <groupId>com.mebigfatguy.sb-contrib</groupId>
                                <artifactId>sb-contrib</artifactId>
                                <version>7.6.4</version>
                            </plugin>
                            <plugin>
                                <groupId>com.h3xstream.findsecbugs</groupId>
                                <artifactId>findsecbugs-plugin</artifactId>
                                <version>1.13.0</version>
                            </plugin>
                        </plugins>
                    </configuration>
                </plugin>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions