This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit 7adeae968ff6df6aa1cc086622821353d3ddb091 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Mar 23 09:23:50 2024 -0400 Checkstyle test fixes - Fix line lengths --- pom.xml | 1211 ++++++++++---------- src/conf/checkstyle-suppressions.xml | 5 +- src/conf/checkstyle.xml | 2 +- .../ConstantPoolModuleToStringTestCase.java | 3 +- .../org/apache/bcel/classfile/UtilityTestCase.java | 43 +- .../apache/bcel/generic/EmptyVisitorTestCase.java | 16 +- .../apache/bcel/verifier/JiraBcel369TestCase.java | 4 +- .../org/apache/bcel/verifier/VerifierTestCase.java | 4 +- .../org/apache/bcel/verifier/tests/JvmOpCodes.java | 3 +- .../bcel/verifier/tests/TestReturn03Creator.java | 8 +- 10 files changed, 659 insertions(+), 640 deletions(-) diff --git a/pom.xml b/pom.xml index f3bd07cf..48ea3ce4 100644 --- a/pom.xml +++ b/pom.xml @@ -1,605 +1,606 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.commons</groupId> - <artifactId>commons-parent</artifactId> - <version>67</version> - </parent> - - <groupId>org.apache.bcel</groupId> - <artifactId>bcel</artifactId> - <packaging>jar</packaging> - <version>6.8.3-SNAPSHOT</version> - <name>Apache Commons BCEL</name> - <description>Apache Commons Bytecode Engineering Library</description> - - <url>https://commons.apache.org/proper/commons-bcel</url> - <inceptionYear>2004</inceptionYear> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <project.build.outputTimestamp>2024-02-25T17:02:58Z</project.build.outputTimestamp> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> - <commons.componentid>bcel</commons.componentid> - <commons.module.name>org.apache.bcel</commons.module.name> - <commons.release.version>6.8.2</commons.release.version> - <commons.release.next>6.8.3</commons.release.next> - <commons.release.isDistModule>true</commons.release.isDistModule> - <commons.rc.version>RC1</commons.rc.version> - <commons.bc.version>6.8.1</commons.bc.version> - <commons.release.desc>(Java 8 or above)</commons.release.desc> - <commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-bcel</commons.scmPubUrl> - <commons.distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}</commons.distSvnStagingUrl> - <!-- Configuration properties for the OSGi maven-bundle-plugin --> - <commons.osgi.symbolicName>org.apache.${commons.componentid}</commons.osgi.symbolicName> - <commons.osgi.export>org.apache.bcel.*;version=${project.version};-noimport:=true</commons.osgi.export> - <commons.osgi.import>*</commons.osgi.import> - <commons.osgi.dynamicImport /> - <commons.osgi.private /> - <commons.jira.id>BCEL</commons.jira.id> - <commons.jira.pid>12314220</commons.jira.pid> - <mockito.version>4.11.0</mockito.version> - <assertj.version>3.25.3</assertj.version> - <jna.version>5.14.0</jna.version> - <japicmp.skip>false</japicmp.skip> - </properties> - - <distributionManagement> - <site> - <id>apache.website</id> - <name>Apache Commons Site</name> - <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-bcel/</url> - </site> - </distributionManagement> - - <ciManagement> - <system>GitHub</system> - <url>https://github.com/apache/commons-bcel/actions</url> - </ciManagement> - - <issueManagement> - <system>jira</system> - <url>https://issues.apache.org/jira/browse/BCEL</url> - </issueManagement> - - <scm> - <connection>scm:git:https://gitbox.apache.org/repos/asf/commons-bcel.git</connection> - <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/commons-bcel.git</developerConnection> - <url>https://gitbox.apache.org/repos/asf?p=commons-bcel.git</url> - </scm> - - <build> - <defaultGoal>clean verify apache-rat:check japicmp:cmp checkstyle:check pmd:check spotbugs:check javadoc:javadoc</defaultGoal> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <configuration> - <excludes> - <exclude>src/test/resources/**</exclude> - <exclude>docs/*.bib</exclude> - <exclude>docs/*.mdl</exclude> - <exclude>docs/eps/*</exclude> - <exclude>**/*.eps</exclude> - <exclude>**/*.bnf</exclude> - <exclude>**/*.mini</exclude> - <exclude>TODO.JustIce</exclude> - <exclude>src/examples/Mini/MiniParser$JJCalls</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - <!-- Temporary fix for BCEL-293, remove this after this has implemented in parent pom --> - <configuration> - <archive combine.children="append"> - <manifestEntries> - <Automatic-Module-Name>org.apache.bcel</Automatic-Module-Name> - </manifestEntries> - </archive> - </configuration> - </plugin> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <testExcludes> - <testExclude>**/*Benchmark*</testExclude> - </testExcludes> - <!-- MethodParameters attribute in class file --> - <parameters>true</parameters> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <executions> - <execution> - <id>attach-sources</id> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <!-- Suppress the stats, but keep the test as it exercises the code --> - <PerformanceTest.report>false</PerformanceTest.report> - </systemPropertyVariables> - <includes> - <include>**/*TestCase.java</include> - <include>**/PerformanceTest.java</include> - </includes> - <excludes> - <exclude>**/Abstract*</exclude> - <!-- Takes rather a long time (especially rt.jar) ; only needs to be done occasionally --> - <exclude>**/JDKClassDumpTestCase.java</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <configuration> - <!-- These need to be specified because CP includes a descriptor --> - <descriptors> - <descriptor>src/assembly/bin.xml</descriptor> - <descriptor>src/assembly/src.xml</descriptor> - </descriptors> - <tarLongFileMode>gnu</tarLongFileMode> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-scm-publish-plugin</artifactId> - <configuration> - <ignorePathsToDelete> - <ignorePathToDelete>javadocs</ignorePathToDelete> - </ignorePathsToDelete> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <configLocation>${basedir}/src/conf/checkstyle.xml</configLocation> - <!-- Needed to define config_loc --> - <propertyExpansion>config_loc=${basedir}</propertyExpansion> - <enableRulesSummary>false</enableRulesSummary> - </configuration> - </plugin> - <plugin> - <groupId>com.github.siom79.japicmp</groupId> - <artifactId>japicmp-maven-plugin</artifactId> - </plugin> - <plugin> - <groupId>com.github.spotbugs</groupId> - <artifactId>spotbugs-maven-plugin</artifactId> - <configuration> - <threshold>Normal</threshold> - <effort>Default</effort> - <excludeFilterFile>src/conf/spotbugs-exclude-filter.xml</excludeFilterFile> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <targetJdk>${maven.compiler.target}</targetJdk> - <rulesets> - <ruleset>${basedir}/src/conf/pmd-ruleset.xml</ruleset> - </rulesets> - </configuration> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <executions> - <execution> - <id>merge-all-jacoco</id> - <goals> - <goal>merge</goal> - </goals> - <phase>install</phase> - <configuration> - <fileSets> - <fileSet> - <directory>${project.build.directory}</directory> - <includes> - <include>*.exec</include> - </includes> - </fileSet> - </fileSets> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <configLocation>${basedir}/src/conf/checkstyle.xml</configLocation> - <!-- Needed to define config_loc --> - <propertyExpansion>config_loc=${basedir}</propertyExpansion> - <enableRulesSummary>false</enableRulesSummary> - </configuration> - <!-- We need to specify reportSets because 2.9.1 creates two reports --> - <reportSets> - <reportSet> - <reports> - <report>checkstyle</report> - </reports> - </reportSet> - </reportSets> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <targetJdk>${maven.compiler.target}</targetJdk> - <linkXRef>true</linkXRef> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>taglist-maven-plugin</artifactId> - <version>3.0.0</version> - <configuration> - <tags> - <tag>TODO</tag> - <tag>NOPMD</tag> - <tag>NOTE</tag> - </tags> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <version>${commons.rat.version}</version> - <configuration> - <excludes> - <exclude>src/test/resources/**</exclude> - <exclude>docs/*.bib</exclude> - <exclude>docs/*.mdl</exclude> - <exclude>docs/eps/*</exclude> - <exclude>**/*.eps</exclude> - <exclude>**/*.bnf</exclude> - <exclude>**/*.mini</exclude> - <exclude>TODO.JustIce</exclude> - <exclude>src/examples/Mini/MiniParser$JJCalls</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <groupId>com.github.siom79.japicmp</groupId> - <artifactId>japicmp-maven-plugin</artifactId> - </plugin> - <plugin> - <groupId>com.github.spotbugs</groupId> - <artifactId>spotbugs-maven-plugin</artifactId> - <configuration> - <threshold>Normal</threshold> - <effort>Default</effort> - <excludeFilterFile>src/conf/spotbugs-exclude-filter.xml</excludeFilterFile> - <!-- Hacky: Don't allow new SpotBugs errors --> - <maxAllowedViolations>9</maxAllowedViolations> - </configuration> - </plugin> - </plugins> - </reporting> - - <dependencies> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>${mockito.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>${assertj.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>${jna.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>${jna.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.14.0</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <scope>test</scope> - </dependency> - <dependency> - <!-- BCEL-336 refers to this specific version. --> - <groupId>javax</groupId> - <artifactId>javaee-api</artifactId> - <version>6.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-exec</artifactId> - <version>1.4.0</version> - <scope>test</scope> - </dependency> - <!-- START very old jars for Justice verifier --> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>wsdl4j</groupId> - <artifactId>wsdl4j</artifactId> - <version>1.5.3</version> - <scope>test</scope> - </dependency> - <!-- END very old jars for Justice verifier --> - <dependency> - <!-- Eclipse compiler: useful to generate specific .class file patterns --> - <groupId>org.eclipse.jdt</groupId> - <artifactId>ecj</artifactId> - <version>3.26.0</version> <!-- last JDK8-compatible version --> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.jetbrains.kotlin</groupId> - <artifactId>kotlin-stdlib</artifactId> - <version>1.9.23</version> - <scope>test</scope> - </dependency> - </dependencies> - - <profiles> - <!-- Profile to build and run PerformanceTest. Use 'mvn test -Pjdk-rt' --> - <profile> - <id>jdk-rt</id> - <build> - <plugins> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <version>${commons.surefire.version}</version> - <configuration> - <includes> - <include>**/PerformanceTest.java</include> - </includes> - </configuration> - </plugin> - </plugins> - </build> - </profile> - - <!-- Profile to build and run the benchmarks. Use 'mvn test -Pbenchmark', and add '-Dbenchmark=foo' to run only the foo benchmark --> - <profile> - <id>benchmark</id> - - <properties> - <skipTests>true</skipTests> - <benchmark>org.apache</benchmark> - <jmh.version>1.37</jmh.version> - </properties> - - <dependencies> - <dependency> - <groupId>org.openjdk.jmh</groupId> - <artifactId>jmh-core</artifactId> - <version>${jmh.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.openjdk.jmh</groupId> - <artifactId>jmh-generator-annprocess</artifactId> - <version>${jmh.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-collections4</artifactId> - <version>4.4</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <!-- Enable the compilation of the benchmarks --> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>${commons.compiler.version}</version> - <configuration combine.self="override"> - <testIncludes> - <testInclude>**/*</testInclude> - </testIncludes> - </configuration> - </plugin> - - <!-- Hook the benchmarks to the test phase --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>benchmark</id> - <phase>test</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <classpathScope>test</classpathScope> - <executable>java</executable> - <arguments> - <argument>-classpath</argument> - <classpath /> - <argument>org.openjdk.jmh.Main</argument> - <argument>-rf</argument> - <argument>json</argument> - <argument>-rff</argument> - <argument>target/jmh-result.json</argument> - <argument>${benchmark}</argument> - </arguments> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - - </profiles> - - <developers> - <developer> - <name>Dave Brosius</name> - <id>dbrosius</id> - <email>dbrosius at mebigfatguy.com</email> - </developer> - <developer> - <name>Torsten Curdt</name> - <id>tcurdt</id> - <email>tcurdt at apache.org</email> - <organization>ASF</organization> - <organizationUrl>http://www.apache.org/</organizationUrl> - <timezone>+1</timezone> - </developer> - <developer> - <name>Markus Dahm</name> - <id>mdahm</id> - <email>m.dahm at gmx.de</email> - <organization>it-frameworksolutions</organization> - </developer> - <developer> - <name>Jason van Zyl</name> - <email>jason at zenplex.com</email> - </developer> - <developer> - <id>ggregory</id> - <name>Gary Gregory</name> - <email>ggregory at apache.org</email> - <url>https://www.garygregory.com</url> - <organization>The Apache Software Foundation</organization> - <organizationUrl>https://www.apache.org/</organizationUrl> - <roles> - <role>PMC Member</role> - </roles> - <timezone>America/New_York</timezone> - <properties> - <picUrl>https://people.apache.org/~ggregory/img/garydgregory80.png</picUrl> - </properties> - </developer> - </developers> - <contributors> - <contributor> - <name>Enver Haase</name> - <email>enver at convergence.de</email> - </contributor> - <contributor> - <name>David Dixon-Peugh</name> - <email>dixonpeugh at yahoo.com</email> - </contributor> - <contributor> - <name>Patrick Beard</name> - <email>beard at netscape.com</email> - </contributor> - <contributor> - <name>Conor MacNeill</name> - <email>conor at cortexbusiness.com.au</email> - </contributor> - <contributor> - <name>Costin Manolache</name> - <email>cmanolache at yahoo.com</email> - </contributor> - <contributor> - <name>Bill Pugh</name> - <email>bill.pugh at gmail.com</email> - </contributor> - <contributor> - <name>First Hop Ltd / Torsten Rueger</name> - </contributor> - <contributor> - <name>Jérôme Leroux</name> - </contributor> - <contributor> - <name>Mark Roberts</name> - </contributor> - <contributor> - <name>Sam Yoon</name> - </contributor> - <contributor> - <name>Arturo Bernal</name> - </contributor> - </contributors> -</project> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.commons</groupId> + <artifactId>commons-parent</artifactId> + <version>67</version> + </parent> + + <groupId>org.apache.bcel</groupId> + <artifactId>bcel</artifactId> + <packaging>jar</packaging> + <version>6.8.3-SNAPSHOT</version> + <name>Apache Commons BCEL</name> + <description>Apache Commons Bytecode Engineering Library</description> + + <url>https://commons.apache.org/proper/commons-bcel</url> + <inceptionYear>2004</inceptionYear> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <project.build.outputTimestamp>2024-02-25T17:02:58Z</project.build.outputTimestamp> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + <commons.componentid>bcel</commons.componentid> + <commons.module.name>org.apache.bcel</commons.module.name> + <commons.release.version>6.8.2</commons.release.version> + <commons.release.next>6.8.3</commons.release.next> + <commons.release.isDistModule>true</commons.release.isDistModule> + <commons.rc.version>RC1</commons.rc.version> + <commons.bc.version>6.8.1</commons.bc.version> + <commons.release.desc>(Java 8 or above)</commons.release.desc> + <commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-bcel</commons.scmPubUrl> + <commons.distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}</commons.distSvnStagingUrl> + <!-- Configuration properties for the OSGi maven-bundle-plugin --> + <commons.osgi.symbolicName>org.apache.${commons.componentid}</commons.osgi.symbolicName> + <commons.osgi.export>org.apache.bcel.*;version=${project.version};-noimport:=true</commons.osgi.export> + <commons.osgi.import>*</commons.osgi.import> + <commons.osgi.dynamicImport /> + <commons.osgi.private /> + <commons.jira.id>BCEL</commons.jira.id> + <commons.jira.pid>12314220</commons.jira.pid> + <mockito.version>4.11.0</mockito.version> + <assertj.version>3.25.3</assertj.version> + <jna.version>5.14.0</jna.version> + <japicmp.skip>false</japicmp.skip> + </properties> + + <distributionManagement> + <site> + <id>apache.website</id> + <name>Apache Commons Site</name> + <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-bcel/</url> + </site> + </distributionManagement> + + <ciManagement> + <system>GitHub</system> + <url>https://github.com/apache/commons-bcel/actions</url> + </ciManagement> + + <issueManagement> + <system>jira</system> + <url>https://issues.apache.org/jira/browse/BCEL</url> + </issueManagement> + + <scm> + <connection>scm:git:https://gitbox.apache.org/repos/asf/commons-bcel.git</connection> + <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/commons-bcel.git</developerConnection> + <url>https://gitbox.apache.org/repos/asf?p=commons-bcel.git</url> + </scm> + + <build> + <defaultGoal>clean verify apache-rat:check japicmp:cmp checkstyle:check pmd:check spotbugs:check javadoc:javadoc</defaultGoal> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludes> + <exclude>src/test/resources/**</exclude> + <exclude>docs/*.bib</exclude> + <exclude>docs/*.mdl</exclude> + <exclude>docs/eps/*</exclude> + <exclude>**/*.eps</exclude> + <exclude>**/*.bnf</exclude> + <exclude>**/*.mini</exclude> + <exclude>TODO.JustIce</exclude> + <exclude>src/examples/Mini/MiniParser$JJCalls</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + <!-- Temporary fix for BCEL-293, remove this after this has implemented in parent pom --> + <configuration> + <archive combine.children="append"> + <manifestEntries> + <Automatic-Module-Name>org.apache.bcel</Automatic-Module-Name> + </manifestEntries> + </archive> + </configuration> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <testExcludes> + <testExclude>**/*Benchmark*</testExclude> + </testExcludes> + <!-- MethodParameters attribute in class file --> + <parameters>true</parameters> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <!-- Suppress the stats, but keep the test as it exercises the code --> + <PerformanceTest.report>false</PerformanceTest.report> + </systemPropertyVariables> + <includes> + <include>**/*TestCase.java</include> + <include>**/PerformanceTest.java</include> + </includes> + <excludes> + <exclude>**/Abstract*</exclude> + <!-- Takes rather a long time (especially rt.jar) ; only needs to be done occasionally --> + <exclude>**/JDKClassDumpTestCase.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <!-- These need to be specified because CP includes a descriptor --> + <descriptors> + <descriptor>src/assembly/bin.xml</descriptor> + <descriptor>src/assembly/src.xml</descriptor> + </descriptors> + <tarLongFileMode>gnu</tarLongFileMode> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-scm-publish-plugin</artifactId> + <configuration> + <ignorePathsToDelete> + <ignorePathToDelete>javadocs</ignorePathToDelete> + </ignorePathsToDelete> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <configLocation>${basedir}/src/conf/checkstyle.xml</configLocation> + <!-- Needed to define config_loc --> + <propertyExpansion>config_loc=${basedir}</propertyExpansion> + <enableRulesSummary>false</enableRulesSummary> + <includeTestSourceDirectory>true</includeTestSourceDirectory> + </configuration> + </plugin> + <plugin> + <groupId>com.github.siom79.japicmp</groupId> + <artifactId>japicmp-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>com.github.spotbugs</groupId> + <artifactId>spotbugs-maven-plugin</artifactId> + <configuration> + <threshold>Normal</threshold> + <effort>Default</effort> + <excludeFilterFile>src/conf/spotbugs-exclude-filter.xml</excludeFilterFile> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>${maven.compiler.target}</targetJdk> + <rulesets> + <ruleset>${basedir}/src/conf/pmd-ruleset.xml</ruleset> + </rulesets> + </configuration> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <executions> + <execution> + <id>merge-all-jacoco</id> + <goals> + <goal>merge</goal> + </goals> + <phase>install</phase> + <configuration> + <fileSets> + <fileSet> + <directory>${project.build.directory}</directory> + <includes> + <include>*.exec</include> + </includes> + </fileSet> + </fileSets> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <configLocation>${basedir}/src/conf/checkstyle.xml</configLocation> + <!-- Needed to define config_loc --> + <propertyExpansion>config_loc=${basedir}</propertyExpansion> + <enableRulesSummary>false</enableRulesSummary> + </configuration> + <!-- We need to specify reportSets because 2.9.1 creates two reports --> + <reportSets> + <reportSet> + <reports> + <report>checkstyle</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>${maven.compiler.target}</targetJdk> + <linkXRef>true</linkXRef> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>3.0.0</version> + <configuration> + <tags> + <tag>TODO</tag> + <tag>NOPMD</tag> + <tag>NOTE</tag> + </tags> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <version>${commons.rat.version}</version> + <configuration> + <excludes> + <exclude>src/test/resources/**</exclude> + <exclude>docs/*.bib</exclude> + <exclude>docs/*.mdl</exclude> + <exclude>docs/eps/*</exclude> + <exclude>**/*.eps</exclude> + <exclude>**/*.bnf</exclude> + <exclude>**/*.mini</exclude> + <exclude>TODO.JustIce</exclude> + <exclude>src/examples/Mini/MiniParser$JJCalls</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>com.github.siom79.japicmp</groupId> + <artifactId>japicmp-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>com.github.spotbugs</groupId> + <artifactId>spotbugs-maven-plugin</artifactId> + <configuration> + <threshold>Normal</threshold> + <effort>Default</effort> + <excludeFilterFile>src/conf/spotbugs-exclude-filter.xml</excludeFilterFile> + <!-- Hacky: Don't allow new SpotBugs errors --> + <maxAllowedViolations>9</maxAllowedViolations> + </configuration> + </plugin> + </plugins> + </reporting> + + <dependencies> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>${mockito.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>${assertj.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>net.java.dev.jna</groupId> + <artifactId>jna</artifactId> + <version>${jna.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>net.java.dev.jna</groupId> + <artifactId>jna-platform</artifactId> + <version>${jna.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.14.0</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.15.1</version> + <scope>test</scope> + </dependency> + <dependency> + <!-- BCEL-336 refers to this specific version. --> + <groupId>javax</groupId> + <artifactId>javaee-api</artifactId> + <version>6.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-exec</artifactId> + <version>1.4.0</version> + <scope>test</scope> + </dependency> + <!-- START very old jars for Justice verifier --> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>wsdl4j</groupId> + <artifactId>wsdl4j</artifactId> + <version>1.5.3</version> + <scope>test</scope> + </dependency> + <!-- END very old jars for Justice verifier --> + <dependency> + <!-- Eclipse compiler: useful to generate specific .class file patterns --> + <groupId>org.eclipse.jdt</groupId> + <artifactId>ecj</artifactId> + <version>3.26.0</version> <!-- last JDK8-compatible version --> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-stdlib</artifactId> + <version>1.9.23</version> + <scope>test</scope> + </dependency> + </dependencies> + + <profiles> + <!-- Profile to build and run PerformanceTest. Use 'mvn test -Pjdk-rt' --> + <profile> + <id>jdk-rt</id> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${commons.surefire.version}</version> + <configuration> + <includes> + <include>**/PerformanceTest.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + </profile> + + <!-- Profile to build and run the benchmarks. Use 'mvn test -Pbenchmark', and add '-Dbenchmark=foo' to run only the foo benchmark --> + <profile> + <id>benchmark</id> + + <properties> + <skipTests>true</skipTests> + <benchmark>org.apache</benchmark> + <jmh.version>1.37</jmh.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.openjdk.jmh</groupId> + <artifactId>jmh-core</artifactId> + <version>${jmh.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.openjdk.jmh</groupId> + <artifactId>jmh-generator-annprocess</artifactId> + <version>${jmh.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.15.1</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + <version>4.4</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <!-- Enable the compilation of the benchmarks --> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${commons.compiler.version}</version> + <configuration combine.self="override"> + <testIncludes> + <testInclude>**/*</testInclude> + </testIncludes> + </configuration> + </plugin> + + <!-- Hook the benchmarks to the test phase --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <executions> + <execution> + <id>benchmark</id> + <phase>test</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <classpathScope>test</classpathScope> + <executable>java</executable> + <arguments> + <argument>-classpath</argument> + <classpath /> + <argument>org.openjdk.jmh.Main</argument> + <argument>-rf</argument> + <argument>json</argument> + <argument>-rff</argument> + <argument>target/jmh-result.json</argument> + <argument>${benchmark}</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + + </profiles> + + <developers> + <developer> + <name>Dave Brosius</name> + <id>dbrosius</id> + <email>dbrosius at mebigfatguy.com</email> + </developer> + <developer> + <name>Torsten Curdt</name> + <id>tcurdt</id> + <email>tcurdt at apache.org</email> + <organization>ASF</organization> + <organizationUrl>http://www.apache.org/</organizationUrl> + <timezone>+1</timezone> + </developer> + <developer> + <name>Markus Dahm</name> + <id>mdahm</id> + <email>m.dahm at gmx.de</email> + <organization>it-frameworksolutions</organization> + </developer> + <developer> + <name>Jason van Zyl</name> + <email>jason at zenplex.com</email> + </developer> + <developer> + <id>ggregory</id> + <name>Gary Gregory</name> + <email>ggregory at apache.org</email> + <url>https://www.garygregory.com</url> + <organization>The Apache Software Foundation</organization> + <organizationUrl>https://www.apache.org/</organizationUrl> + <roles> + <role>PMC Member</role> + </roles> + <timezone>America/New_York</timezone> + <properties> + <picUrl>https://people.apache.org/~ggregory/img/garydgregory80.png</picUrl> + </properties> + </developer> + </developers> + <contributors> + <contributor> + <name>Enver Haase</name> + <email>enver at convergence.de</email> + </contributor> + <contributor> + <name>David Dixon-Peugh</name> + <email>dixonpeugh at yahoo.com</email> + </contributor> + <contributor> + <name>Patrick Beard</name> + <email>beard at netscape.com</email> + </contributor> + <contributor> + <name>Conor MacNeill</name> + <email>conor at cortexbusiness.com.au</email> + </contributor> + <contributor> + <name>Costin Manolache</name> + <email>cmanolache at yahoo.com</email> + </contributor> + <contributor> + <name>Bill Pugh</name> + <email>bill.pugh at gmail.com</email> + </contributor> + <contributor> + <name>First Hop Ltd / Torsten Rueger</name> + </contributor> + <contributor> + <name>Jérôme Leroux</name> + </contributor> + <contributor> + <name>Mark Roberts</name> + </contributor> + <contributor> + <name>Sam Yoon</name> + </contributor> + <contributor> + <name>Arturo Bernal</name> + </contributor> + </contributors> +</project> diff --git a/src/conf/checkstyle-suppressions.xml b/src/conf/checkstyle-suppressions.xml index e0ef08d9..bf3c1e68 100644 --- a/src/conf/checkstyle-suppressions.xml +++ b/src/conf/checkstyle-suppressions.xml @@ -22,11 +22,10 @@ limitations under the License. <!-- SEE: http://checkstyle.sourceforge.net/config.html#Examples --> <suppressions> <suppress checks="LineLength" files="InstructionFinder.java"/> <!-- TODO later --> - <suppress checks="MagicNumber" files="VerifierAppFrame.java"/> <!-- Swing files use lots of numbers --> <suppress checks="MagicNumber" files="VerifyDialog.java"/> <!-- Swing files use lots of numbers --> <suppress checks="MagicNumber" files="src[/\\]test[/\\]"/> <!-- test files need numbers --> - - <!-- Maven generated code --> <suppress checks=".*" files="[/\\]target[/\\]"/> + <suppress checks="VisibilityModifier" files="StaticFieldVerifierSuperClass.java" lines="22,23,24,26"/> + <suppress checks="VisibilityModifier" files="FieldVerifierSuperClass.java" lines="22,16,24,19"/> </suppressions> diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml index cd9593bc..21cee04d 100644 --- a/src/conf/checkstyle.xml +++ b/src/conf/checkstyle.xml @@ -63,7 +63,7 @@ limitations under the License. </module> <module name="LineLength"> - <property name="max" value="160"/> + <property name="max" value="180"/> </module> <module name="TreeWalker"> diff --git a/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleToStringTestCase.java b/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleToStringTestCase.java index e7f08c96..b63564b5 100644 --- a/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleToStringTestCase.java +++ b/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleToStringTestCase.java @@ -506,7 +506,8 @@ public class ConstantPoolModuleToStringTestCase { @ValueSource(strings = { // @formatter:off "java.lang.CharSequence$1CharIterator", // contains attribute EnclosingMethod - "org.apache.commons.lang3.function.TriFunction", // contains attributes BootstrapMethods, InnerClasses, LineNumberTable, LocalVariableTable, LocalVariableTypeTable, RuntimeVisibleAnnotations, Signature, SourceFile + "org.apache.commons.lang3.function.TriFunction", // contains attributes BootstrapMethods, InnerClasses, LineNumberTable, LocalVariableTable, + // LocalVariableTypeTable, RuntimeVisibleAnnotations, Signature, SourceFile "org.apache.commons.lang3.math.NumberUtils", // contains attribute ConstantFloat, ConstantDouble "org.apache.bcel.Const", // contains attributes MethodParameters "java.io.StringBufferInputStream", // contains attributes Deprecated, StackMap diff --git a/src/test/java/org/apache/bcel/classfile/UtilityTestCase.java b/src/test/java/org/apache/bcel/classfile/UtilityTestCase.java index 8c3144b6..75e0be1a 100644 --- a/src/test/java/org/apache/bcel/classfile/UtilityTestCase.java +++ b/src/test/java/org/apache/bcel/classfile/UtilityTestCase.java @@ -59,7 +59,10 @@ public class UtilityTestCase { final String code = method.getCode().toString(false); assertTrue(code.contains("0: aload_0"), code); assertTrue(code.contains("1: aload_1"), code); - assertTrue(code.contains("2: putfield\t\torg.apache.bcel.classfile.UtilityTestCase$1CodeToString.this$0 Lorg/apache/bcel/classfile/UtilityTestCase;"), code); + assertTrue( + code.contains( + "2: putfield\t\torg.apache.bcel.classfile.UtilityTestCase$1CodeToString.this$0 Lorg/apache/bcel/classfile/UtilityTestCase;"), + code); assertTrue(code.contains("5: aload_0"), code); assertTrue(code.contains("6: invokespecial\tjava.lang.Object.<init> ()V"), code); assertTrue(code.contains("9: aload_0"), code); @@ -108,11 +111,11 @@ public class UtilityTestCase { assertEquals(null, Utility.printArray(null, false, false)); assertEquals("", Utility.printArray(new Object[0], false, false)); assertEquals("{}", Utility.printArray(new Object[0], true, false)); - assertEquals("null", Utility.printArray(new Object[]{null}, false, false)); - assertEquals("a, b", Utility.printArray(new String[]{"a", "b"}, false, false)); - assertEquals("{a, b}", Utility.printArray(new String[]{"a", "b"}, true, false)); - assertEquals("\"a\", \"b\"", Utility.printArray(new String[]{"a", "b"}, false, true)); - assertEquals("{\"a\", \"b\"}", Utility.printArray(new String[]{"a", "b"}, true, true)); + assertEquals("null", Utility.printArray(new Object[] { null }, false, false)); + assertEquals("a, b", Utility.printArray(new String[] { "a", "b" }, false, false)); + assertEquals("{a, b}", Utility.printArray(new String[] { "a", "b" }, true, false)); + assertEquals("\"a\", \"b\"", Utility.printArray(new String[] { "a", "b" }, false, true)); + assertEquals("{\"a\", \"b\"}", Utility.printArray(new String[] { "a", "b" }, true, true)); } @Test @@ -141,35 +144,35 @@ public class UtilityTestCase { // tests for BCEL-197 assertEquals("java.util.Map<X, java.util.List<Y>>", Utility.signatureToString("Ljava/util/Map<TX;Ljava/util/List<TY;>;>;"), "generic signature"); assertEquals("java.util.Set<? extends java.nio.file.OpenOption>", Utility.signatureToString("Ljava/util/Set<+Ljava/nio/file/OpenOption;>;"), - "generic signature"); + "generic signature"); assertEquals("java.nio.file.attribute.FileAttribute<?>[]", Utility.signatureToString("[Ljava/nio/file/attribute/FileAttribute<*>;"), - "generic signature"); + "generic signature"); // tests for BCEL-286 assertEquals( - "boofcv.alg.tracker.tld.TldTracker<boofcv.struct.image.ImageGray<boofcv.struct.image.GrayU8>, boofcv.struct.image.GrayI<boofcv.struct.image.GrayU8>>", + "boofcv.alg.tracker.tld.TldTracker<boofcv.struct.image.ImageGray<boofcv.struct.image.GrayU8>, boofcv.struct.image.GrayI<boofcv.struct.image.GrayU8>>", Utility.signatureToString( - "Lboofcv/alg/tracker/tld/TldTracker<Lboofcv/struct/image/ImageGray<Lboofcv/struct/image/GrayU8;>;Lboofcv/struct/image/GrayI<Lboofcv/struct/image/GrayU8;>;>;"), - "generic signature"); + "Lboofcv/alg/tracker/tld/TldTracker<Lboofcv/struct/image/ImageGray<Lboofcv/struct/image/GrayU8;>;Lboofcv/struct/image/GrayI<Lboofcv/struct/image/GrayU8;>;>;"), + "generic signature"); assertEquals("java.util.Map<?, ?>", Utility.signatureToString("Ljava/util/Map<**>;"), "generic signature"); assertEquals("com.jme3.util.IntMap<T>.IntMapIterator", Utility.signatureToString("Lcom/jme3/util/IntMap<TT;>.IntMapIterator;"), "generic signature"); // tests for BCEL-279 assertEquals("<T extends java.lang.Object>(com.google.common.io.ByteProcessor<T>, int)T", - Utility.signatureToString("<T:Ljava/lang/Object;>(Lcom/google/common/io/ByteProcessor<TT;>;I)TT;", false), "type parameters signature"); + Utility.signatureToString("<T:Ljava/lang/Object;>(Lcom/google/common/io/ByteProcessor<TT;>;I)TT;", false), "type parameters signature"); assertEquals("<T extends Object>(com.google.common.io.ByteProcessor<T>, int)T", - Utility.signatureToString("<T:Ljava/lang/Object;>(Lcom/google/common/io/ByteProcessor<TT;>;I)TT;", true), "type parameters signature"); + Utility.signatureToString("<T:Ljava/lang/Object;>(Lcom/google/common/io/ByteProcessor<TT;>;I)TT;", true), "type parameters signature"); assertEquals("<M extends java.lang.reflect.AccessibleObject & java.lang.reflect.Member>(M)void", - Utility.signatureToString("<M:Ljava/lang/reflect/AccessibleObject;:Ljava/lang/reflect/Member;>(TM;)V"), "type parameters signature"); + Utility.signatureToString("<M:Ljava/lang/reflect/AccessibleObject;:Ljava/lang/reflect/Member;>(TM;)V"), "type parameters signature"); assertEquals("<K1 extends K, V1 extends V>()com.google.common.cache.Weigher<K1, V1>", - Utility.signatureToString("<K1:TK;V1:TV;>()Lcom/google/common/cache/Weigher<TK1;TV1;>;"), "type parameters signature"); + Utility.signatureToString("<K1:TK;V1:TV;>()Lcom/google/common/cache/Weigher<TK1;TV1;>;"), "type parameters signature"); assertEquals("<K1 extends K, V1 extends V>(com.google.common.cache.Weigher<? super K1, ? super V1>)com.google.common.cache.CacheBuilder<K1, V1>", - Utility.signatureToString("<K1:TK;V1:TV;>(Lcom/google/common/cache/Weigher<-TK1;-TV1;>;)Lcom/google/common/cache/CacheBuilder<TK1;TV1;>;"), - "type parameters signature"); + Utility.signatureToString("<K1:TK;V1:TV;>(Lcom/google/common/cache/Weigher<-TK1;-TV1;>;)Lcom/google/common/cache/CacheBuilder<TK1;TV1;>;"), + "type parameters signature"); assertEquals("<N extends java.lang.Object, E extends java.lang.Object> extends java.lang.Object implements com.google.common.graph.Network<N, E>", - Utility.signatureToString("<N:Ljava/lang/Object;E:Ljava/lang/Object;>Ljava/lang/Object;Lcom/google/common/graph/Network<TN;TE;>;", false), - "class signature"); + Utility.signatureToString("<N:Ljava/lang/Object;E:Ljava/lang/Object;>Ljava/lang/Object;Lcom/google/common/graph/Network<TN;TE;>;", false), + "class signature"); assertEquals("<K extends Object, V extends Object> extends Object", - Utility.signatureToString("<K:Ljava/lang/Object;V:Ljava/lang/Object;>Ljava/lang/Object;"), "class signature"); + Utility.signatureToString("<K:Ljava/lang/Object;V:Ljava/lang/Object;>Ljava/lang/Object;"), "class signature"); } } diff --git a/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java b/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java index cdbb808b..15647fcf 100644 --- a/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java +++ b/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java @@ -38,9 +38,19 @@ final class EmptyVisitorTestCase { @ParameterizedTest @ValueSource(strings = { // @formatter:off - "java.math.BigInteger", // contains instructions [AALOAD, AASTORE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CHECKCAST, D2I, DADD, DALOAD, DASTORE, DCONST, DDIV, DMUL, DRETURN, DSUB, DUP, DUP2, DUP_X2, FCONST, FRETURN, GETFIELD, GETSTATIC, GOTO, I2B, I2D, I2L, IADD, IALOAD, IAND, IASTORE, ICONST, IDIV, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMP [...] - "java.math.BigDecimal", // contains instructions [CASTORE, D2L, DLOAD, FALOAD, FASTORE, FDIV, FMUL, I2S, IF_ACMPEQ, LXOR, MONITORENTER, MONITOREXIT, TABLESWITCH] - "java.awt.Color", // contains instructions [D2F, DCMPG, DCMPL, F2D, F2I, FADD, FCMPG, FCMPL, FLOAD, FSTORE, FSUB, I2F, INVOKEDYNAMIC] + "java.math.BigInteger", // contains instructions [AALOAD, AASTORE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, + // ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CHECKCAST, D2I, DADD, DALOAD, DASTORE, DCONST + // DDIV, DMUL, DRETURN, DSUB, DUP, DUP2, DUP_X2, FCONST, FRETURN, GETFIELD, GETSTATIC, GOTO, I2B, + // I2D, I2L, IADD, IALOAD, IAND, IASTORE, ICONST, IDIV, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, + // IFNONNULL, IFNULL, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, + // IINC, ILOAD, IMUL, INEG, INSTANCEOF, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, + // IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, + // LCONST, LDC, LDC2_W, LDC_W, LDIV, LLOAD, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, + // LSTORE, LSUB, LUSHR, NEW, NEWARRAY, POP, PUTFIELD, PUTSTATIC, RETURN, SIPUSH] + "java.math.BigDecimal", // contains instructions [CASTORE, D2L, DLOAD, FALOAD, FASTORE, FDIV, FMUL, I2S, IF_ACMPEQ, LXOR, + // MONITORENTER, MONITOREXIT, TABLESWITCH] + "java.awt.Color", // contains instructions [D2F, DCMPG, DCMPL, F2D, F2I, FADD, FCMPG, FCMPL, FLOAD, FSTORE, FSUB, I2F, + // INVOKEDYNAMIC] "java.util.Map", // contains instruction INVOKEINTERFACE "java.io.Bits", // contains instruction I2C "java.io.BufferedInputStream", // contains instruction DUP_X1 diff --git a/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java b/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java index 5a8502d1..48948199 100644 --- a/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java +++ b/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java @@ -34,7 +34,9 @@ public class JiraBcel369TestCase extends AbstractTestCase { /** * 3.7.0 fails with * <pre>{@code - * org.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL ERROR: Some RuntimeException occurred while verify()ing class 'issue369.Test', method 'public void <init>(int arg1)'. Original RuntimeException's stack trace: + * org.apache.bcel.verifier.exc.AssertionViolatedException: + * INTERNAL ERROR: Some RuntimeException occurred while verify()ing class 'issue369.Test', method 'public void <init>(int arg1)'. + * Original RuntimeException's stack trace: --- org.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL ERROR: outFrame not set! This: 24: return [InstructionContext] diff --git a/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java b/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java index 951c0c8a..314fb6b6 100644 --- a/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java +++ b/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java @@ -133,7 +133,7 @@ public class VerifierTestCase { @Test public void testJvmOpCodes() throws ClassNotFoundException { - testDefaultMethodValidation("org.apache.bcel.verifier.tests.JvmOpCodes"); + testDefaultMethodValidation("org.apache.bcel.verifier.tests.JvmOpCodes"); } @Test @@ -160,6 +160,6 @@ public class VerifierTestCase { @Test public void testWSDL() throws IOException, URISyntaxException, ClassNotFoundException { - testJarFile(getJarFile(javax.wsdl.Port.class), "WSDLReaderImpl", "DefinitionImpl"); + testJarFile(getJarFile(javax.wsdl.Port.class), "WSDLReaderImpl", "DefinitionImpl"); } } diff --git a/src/test/java/org/apache/bcel/verifier/tests/JvmOpCodes.java b/src/test/java/org/apache/bcel/verifier/tests/JvmOpCodes.java index 2d58c43e..1a6b99fc 100644 --- a/src/test/java/org/apache/bcel/verifier/tests/JvmOpCodes.java +++ b/src/test/java/org/apache/bcel/verifier/tests/JvmOpCodes.java @@ -41,7 +41,8 @@ import org.apache.bcel.generic.POP2; */ public class JvmOpCodes { - long l1, l2; + long l1; + long l2; /** * Tests {@link DNEG}. diff --git a/src/test/java/org/apache/bcel/verifier/tests/TestReturn03Creator.java b/src/test/java/org/apache/bcel/verifier/tests/TestReturn03Creator.java index 097f859e..878709d3 100644 --- a/src/test/java/org/apache/bcel/verifier/tests/TestReturn03Creator.java +++ b/src/test/java/org/apache/bcel/verifier/tests/TestReturn03Creator.java @@ -39,7 +39,8 @@ public abstract class TestReturn03Creator extends TestCreator { private final String genClassSuffix; protected TestReturn03Creator(final Type returnType, final String genClassSuffix) { - classGen = new ClassGen(TEST_PACKAGE + ".TestReturn03" + genClassSuffix, "java.lang.Object", "TestReturn03.java", Const.ACC_PUBLIC | Const.ACC_SUPER, new String[] {}); + classGen = new ClassGen(TEST_PACKAGE + ".TestReturn03" + genClassSuffix, "java.lang.Object", "TestReturn03.java", Const.ACC_PUBLIC | Const.ACC_SUPER, + new String[] {}); constantPoolGen = classGen.getConstantPool(); instructionFactory = new InstructionFactory(classGen, constantPoolGen); @@ -56,7 +57,8 @@ public abstract class TestReturn03Creator extends TestCreator { private void createMethod_0() { final InstructionList il = new InstructionList(); - final MethodGen method = new MethodGen(Const.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] {}, "<init>", TEST_PACKAGE + ".TestReturn03", il, constantPoolGen); + final MethodGen method = new MethodGen(Const.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] {}, "<init>", TEST_PACKAGE + ".TestReturn03", il, + constantPoolGen); final InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); assertNotNull(ih_0); // TODO why is this not used @@ -72,7 +74,7 @@ public abstract class TestReturn03Creator extends TestCreator { private void createMethod_1() { final InstructionList il = new InstructionList(); final MethodGen method = new MethodGen(Const.ACC_PUBLIC | Const.ACC_STATIC, Type.INT, Type.NO_ARGS, new String[] {}, "test3", - TEST_PACKAGE + ".TestReturn03" + genClassSuffix, il, constantPoolGen); + TEST_PACKAGE + ".TestReturn03" + genClassSuffix, il, constantPoolGen); final InstructionHandle ih_0 = il.append(InstructionConst.ACONST_NULL); assertNotNull(ih_0); // TODO why is this not used