To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 7cc724dc authored by John Zhang's avatar John Zhang
Browse files

merge PMD 5.7.0

parents daf66bf1 f9f5d8cd
Pipeline #1754 failed with stage
in 25 minutes and 6 seconds
......@@ -11,41 +11,67 @@
<property file="dacapo.properties"/>
<property name="bm-name" value="pmd"/>
<property name="bm-version" value="4.2.5"/>
<property name="bm-url" value="${sourceforge.dl.url}/pmd/pmd/4.2.5"/>
<property name="bm-version" value="5.7.0"/>
<property name="bm-url" value="${github.url}/pmd/pmd/releases/download/pmd_releases%2F${bm-version}"/>
<property name="bm-src" value="${bm-name}-src-${bm-version}.zip"/>
<property name="jaxen-version" value="1.1.1"/>
<property name="asm-version" value="3.1"/>
<property name="jaxen-version" value="1.1.6"/>
<property name="asm-version" value="5.0.4"/>
<property name="commons-io-version" value="2.4"/>
<property name="commons-lang3-version" value="3.4"/>
<property name="jcommander-version" value="1.48"/>
<property name="saxon-version" value="9.1.0.8"/>
<property name="mvn-home" location="${toolsdir}/apache-maven-${mvn.version}/bin"/>
<property name="mvn-exe" value="${mvn-home}/mvn"/>
<condition property="mvn-exe" value="${mvn-home}/mvn.bat">
<os family="windows"/>
</condition>
<import file="../common.xml"/>
<property name="bm-build-top" value="${bm-build-dir}/pmd-${bm-version}"/>
<property name="bm-build-top" value="${bm-build-dir}/pmd-src-${bm-version}"/>
<target name="unpack" depends="unzip, patch"/>
<target name="bm-build" depends="xerces">
<!-- build JUnit -->
<ant antfile="libs/junit/build.xml"/>
<exec dir="${bm-build-top}/bin" executable="ant">
<arg value="jar"/>
<env key="CLASSPATH" value=".:${junit-jar}"/>
<env key="ANT_HOME" value="${ant.install}"/>
<!-- set up toolchains.xml for Maven -->
<property name="mvn-toolchains-xml" value="${bm-build-top}/toolchains.xml"/>
<exec executable="${bm-files}/mvn_toolchain_setup.sh">
<arg line="${mvn-toolchains-xml}"/>
</exec>
<!-- execute Maven in build directory -->
<exec dir="${bm-build-top}" executable="${mvn-exe}">
<arg line="-B --global-toolchains ${mvn-toolchains-xml} -Dmaven.test.skip=true clean package"/>
</exec>
<!-- unpacks produced zip file -->
<property name="pmd-dist-target" value="${bm-build-top}/pmd-dist/target/pmd-bin-${bm-version}"/>
<unzip src="${pmd-dist-target}.zip" dest="${bm-build-top}/pmd-dist/target"/>
</target>
<target name="jar" depends="libs">
<copy file="${bm-build-top}/lib/pmd-${bm-version}.jar" todir="${bm-jars}"/>
<copy todir="${bm-jars}">
<resources>
<file file="${pmd-dist-target}/lib/pmd-core-${bm-version}.jar"/>
<file file="${pmd-dist-target}/lib/pmd-java-${bm-version}.jar"/>
</resources>
</copy>
</target>
<target name="data">
<property name="pmd-data" value="${bm-build-top}/data/pmd"/>
<mkdir dir="${pmd-data}"/>
<copy todir="${pmd-data}">
<fileset dir="${bm-build-top}/src">
<include name="net/**/*.java"/>
<fileset dir="${bm-build-top}">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${pmd-data}">
<fileset dir="${bm-build-top}">
<fileset dir="${bm-build-top}/pmd-java/src/main/resources">
<include name="rulesets/**/*"/>
</fileset>
</copy>
......@@ -59,7 +85,16 @@
</target>
<target name="libs">
<copy file="${bm-build-top}/lib/jaxen-${jaxen-version}.jar" todir="${bm-jars}"/>
<copy file="${bm-build-top}/lib/asm-${asm-version}.jar" todir="${bm-jars}"/>
<copy todir="${bm-jars}">
<resources>
<file file="${pmd-dist-target}/lib/jaxen-${jaxen-version}.jar"/>
<file file="${pmd-dist-target}/lib/asm-${asm-version}.jar"/>
<file file="${pmd-dist-target}/lib/commons-io-${commons-io-version}.jar"/>
<file file="${pmd-dist-target}/lib/commons-lang3-${commons-lang3-version}.jar"/>
<file file="${pmd-dist-target}/lib/jcommander-${jcommander-version}.jar"/>
<file file="${pmd-dist-target}/lib/saxon-${saxon-version}.jar"/>
<file file="${pmd-dist-target}/lib/saxon-${saxon-version}-dom.jar"/>
</resources>
</copy>
</target>
</project>
This diff is collapsed.
This diff is collapsed.
pmd/net/sourceforge/pmd/ast/AccessNodeInterface.java
pmd/net/sourceforge/pmd/ast/CompilationUnit.java
pmd/net/sourceforge/pmd/ast/SimpleJavaAccessNode.java
pmd/net/sourceforge/pmd/ast/SimpleJavaAccessTypeNode.java
pmd/net/sourceforge/pmd/ast/SimpleJavaNode.java
pmd/net/sourceforge/pmd/ast/SimpleJavaTypeNode.java
pmd/net/sourceforge/pmd/ast/SimpleNode.java
pmd/net/sourceforge/pmd/CommandLineOptions.java
pmd/net/sourceforge/pmd/CommonAbstractRule.java
pmd/net/sourceforge/pmd/cpd/cppast/CPPParserConstants.java
pmd/net/sourceforge/pmd/cpd/cppast/CPPParserTokenManager.java
pmd/net/sourceforge/pmd/cpd/SourceFileOrDirectoryFilter.java
pmd/net/sourceforge/pmd/dfa/DaaRule.java
pmd/net/sourceforge/pmd/dfa/IDataFlowNode.java
pmd/net/sourceforge/pmd/ExternalRuleID.java
pmd/net/sourceforge/pmd/IRuleViolation.java
pmd/net/sourceforge/pmd/jsp/ast/JspCharStream.java
pmd/net/sourceforge/pmd/jsp/ast/SimpleNode.java
pmd/net/sourceforge/pmd/jsp/rules/DuplicateJspImports.java
pmd/net/sourceforge/pmd/jsp/rules/NoInlineStyleInformation.java
pmd/net/sourceforge/pmd/parsers/JspParser.java
pmd/net/sourceforge/pmd/properties/AbstractPMDProperty.java
pmd/net/sourceforge/pmd/quickfix/Fix.java
pmd/net/sourceforge/pmd/renderers/OnTheFlyRenderer.java
pmd/net/sourceforge/pmd/renderers/PapariTextRenderer.java
pmd/net/sourceforge/pmd/rules/AccessorClassGeneration.java
pmd/net/sourceforge/pmd/rules/AssignmentInOperand.java
pmd/net/sourceforge/pmd/rules/AvoidCallingFinalize.java
pmd/net/sourceforge/pmd/rules/AvoidFieldNameMatchingMethodName.java
pmd/net/sourceforge/pmd/rules/AvoidFieldNameMatchingTypeName.java
pmd/net/sourceforge/pmd/rules/AvoidNonConstructorMethodsWithClassName.java
pmd/net/sourceforge/pmd/rules/AvoidReassigningParameters.java
pmd/net/sourceforge/pmd/rules/basic/AvoidMultipleUnaryOperators.java
pmd/net/sourceforge/pmd/rules/basic/AvoidUsingHardCodedIP.java
pmd/net/sourceforge/pmd/rules/basic/AvoidUsingOctalValues.java
pmd/net/sourceforge/pmd/rules/basic/BigIntegerInstantiation.java
pmd/net/sourceforge/pmd/rules/basic/BooleanInstantiation.java
pmd/net/sourceforge/pmd/rules/basic/BrokenNullCheck.java
pmd/net/sourceforge/pmd/rules/basic/UnnecessaryReturn.java
pmd/net/sourceforge/pmd/rules/ClassNamingConventions.java
pmd/net/sourceforge/pmd/rules/CloseResource.java
pmd/net/sourceforge/pmd/rules/codesize/AbstractNcssCount.java
pmd/net/sourceforge/pmd/rules/codesize/NcssConstructorCount.java
pmd/net/sourceforge/pmd/rules/codesize/NcssMethodCount.java
pmd/net/sourceforge/pmd/rules/codesize/NcssTypeCount.java
pmd/net/sourceforge/pmd/rules/ConstructorCallsOverridableMethod.java
pmd/net/sourceforge/pmd/rules/CouplingBetweenObjects.java
pmd/net/sourceforge/pmd/rules/CyclomaticComplexity.java
pmd/net/sourceforge/pmd/rules/design/AssignmentToNonFinalStatic.java
pmd/net/sourceforge/pmd/rules/design/CompareObjectsWithEquals.java
pmd/net/sourceforge/pmd/rules/design/ConfusingTernary.java
pmd/net/sourceforge/pmd/rules/design/ExceptionAsFlowControl.java
pmd/net/sourceforge/pmd/rules/design/ImmutableField.java
pmd/net/sourceforge/pmd/rules/design/LongClassRule.java
pmd/net/sourceforge/pmd/rules/design/LongMethodRule.java
pmd/net/sourceforge/pmd/rules/design/LongParameterListRule.java
pmd/net/sourceforge/pmd/rules/design/NonThreadSafeSingleton.java
pmd/net/sourceforge/pmd/rules/design/NpathComplexity.java
pmd/net/sourceforge/pmd/rules/design/PreserveStackTrace.java
pmd/net/sourceforge/pmd/rules/design/SingularField.java
pmd/net/sourceforge/pmd/rules/design/TooManyFields.java
pmd/net/sourceforge/pmd/rules/design/UnnecessaryLocalBeforeReturn.java
pmd/net/sourceforge/pmd/rules/design/UnsynchronizedStaticDateFormatter.java
pmd/net/sourceforge/pmd/rules/design/UseCollectionIsEmpty.java
pmd/net/sourceforge/pmd/rules/design/UseSingleton.java
pmd/net/sourceforge/pmd/rules/DoubleCheckedLocking.java
pmd/net/sourceforge/pmd/rules/ExcessiveImports.java
pmd/net/sourceforge/pmd/rules/ExcessivePublicCount.java
pmd/net/sourceforge/pmd/rules/IdempotentOperations.java
pmd/net/sourceforge/pmd/rules/imports/DontImportJavaLang.java
pmd/net/sourceforge/pmd/rules/imports/DontImportSun.java
pmd/net/sourceforge/pmd/rules/junit/JUnitAssertionsShouldIncludeMessage.java
pmd/net/sourceforge/pmd/rules/junit/JUnitTestsShouldContainAsserts.java
pmd/net/sourceforge/pmd/rules/junit/TestClassWithoutTestCases.java
pmd/net/sourceforge/pmd/rules/MethodNamingConventions.java
pmd/net/sourceforge/pmd/rules/MethodWithSameNameAsEnclosingClass.java
pmd/net/sourceforge/pmd/rules/migration/JUnitUseExpected.java
pmd/net/sourceforge/pmd/rules/migration/UnnecessaryCast.java
pmd/net/sourceforge/pmd/rules/MoreThanOneLogger.java
pmd/net/sourceforge/pmd/rules/naming/AvoidDollarSigns.java
pmd/net/sourceforge/pmd/rules/naming/SuspiciousHashcodeMethodName.java
pmd/net/sourceforge/pmd/rules/optimization/AvoidInstantiatingObjectsInLoops.java
pmd/net/sourceforge/pmd/rules/optimization/LocalVariableCouldBeFinal.java
pmd/net/sourceforge/pmd/rules/optimization/MethodArgumentCouldBeFinal.java
pmd/net/sourceforge/pmd/rules/optimization/UnnecessaryWrapperObjectCreation.java
pmd/net/sourceforge/pmd/rules/optimization/UseStringBufferForStringAppends.java
pmd/net/sourceforge/pmd/rules/OverrideBothEqualsAndHashcode.java
pmd/net/sourceforge/pmd/rules/SimplifyBooleanReturns.java
pmd/net/sourceforge/pmd/rules/strictexception/AvoidCatchingThrowable.java
pmd/net/sourceforge/pmd/rules/strictexception/ExceptionSignatureDeclaration.java
pmd/net/sourceforge/pmd/rules/strings/AppendCharacterWithChar.java
pmd/net/sourceforge/pmd/rules/strings/ConsecutiveLiteralAppends.java
pmd/net/sourceforge/pmd/rules/strings/InefficientEmptyStringCheck.java
pmd/net/sourceforge/pmd/rules/strings/InefficientStringBuffering.java
pmd/net/sourceforge/pmd/rules/strings/InsufficientStringBufferDeclaration.java
pmd/net/sourceforge/pmd/rules/strings/StringInstantiation.java
pmd/net/sourceforge/pmd/rules/strings/UnnecessaryCaseChange.java
pmd/net/sourceforge/pmd/rules/strings/UseIndexOfChar.java
pmd/net/sourceforge/pmd/rules/strings/UselessStringValueOf.java
pmd/net/sourceforge/pmd/rules/strings/UseStringBufferLength.java
pmd/net/sourceforge/pmd/rules/sunsecure/ArrayIsStoredDirectly.java
pmd/net/sourceforge/pmd/rules/sunsecure/MethodReturnsInternalArray.java
pmd/net/sourceforge/pmd/rules/SuspiciousOctalEscape.java
pmd/net/sourceforge/pmd/rules/UnnecessaryConversionTemporary.java
pmd/net/sourceforge/pmd/rules/UnusedModifier.java
pmd/net/sourceforge/pmd/rules/UselessOperationOnImmutable.java
pmd/net/sourceforge/pmd/rules/UselessOverridingMethod.java
pmd/net/sourceforge/pmd/rules/VariableNamingConventions.java
pmd/net/sourceforge/pmd/SimpleRuleSetNameMapper.java
pmd/net/sourceforge/pmd/SourceFileConstants.java
pmd/net/sourceforge/pmd/SourceFileSelector.java
pmd/net/sourceforge/pmd/SourceType.java
pmd/net/sourceforge/pmd/SourceTypeDiscoverer.java
pmd/net/sourceforge/pmd/sourcetypehandlers/JavaTypeHandler.java
pmd/net/sourceforge/pmd/sourcetypehandlers/JspTypeHandler.java
pmd/net/sourceforge/pmd/sourcetypehandlers/SourceTypeHandler.java
pmd/net/sourceforge/pmd/sourcetypehandlers/SourceTypeHandlerBroker.java
pmd/net/sourceforge/pmd/SourceTypeToRuleLanguageMapper.java
pmd/net/sourceforge/pmd/symboltable/DummyScope.java
pmd/net/sourceforge/pmd/symboltable/JspScopeAndDeclarationFinder.java
pmd/net/sourceforge/pmd/symboltable/JspSymbolFacade.java
pmd/net/sourceforge/pmd/symboltable/VariableUsageFinderFunction.java
pmd/net/sourceforge/pmd/TargetJDK1_3.java
pmd/net/sourceforge/pmd/TargetJDK1_4.java
pmd/net/sourceforge/pmd/TargetJDK1_5.java
pmd/net/sourceforge/pmd/TargetJDK1_6.java
pmd/net/sourceforge/pmd/TargetJDK1_7.java
pmd/net/sourceforge/pmd/TargetJDKVersion.java
pmd/net/sourceforge/pmd/util/designer/MyPrintStream.java
pmd/net/sourceforge/pmd/util/SymbolTableViewer.java
pmd/net/sourceforge/pmd/util/UnaryFunction.java
pmd/net/sourceforge/pmd/util/XPathTest.java
\ No newline at end of file
pmd/net/sourceforge/pmd/ast/Token.java
pmd/pmd-vm/target/generated-sources/javacc/net/sourceforge/pmd/lang/vm/ast/Token.java
\ No newline at end of file
......@@ -8,9 +8,14 @@
*/
package org.dacapo.harness;
import java.io.BufferedWriter;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
......@@ -42,48 +47,78 @@ public class Pmd extends Benchmark {
* set.
*/
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
}
public void prepare(String size) {
args = config.getArgs(size);
if (args[0].charAt(0) == '@')
args[0] = collectFilesFromFile(fileInScratch(args[0].substring(1)));
for (int i = 2; i < args.length; i++) {
if (args[i].charAt(0) != '-')
args[i] = fileInScratch(args[i]);
}
}
public void iterate(String size) throws Exception {
method.invoke(null, (Object) args);
// Set System property so that PMD won't call System.exit() after run.
Class pmdcli = Class.forName("net.sourceforge.pmd.cli.PMDCommandLineInterface", true, loader);
System.setProperty((String)pmdcli.getField("NO_EXIT_AFTER_RUN").get(null), "true");
}
private String collectFilesFromFile(String inputFileName) {
/**
* Generate a new file list that has the scrath directory path
* prepended to each file in the list
*/
private File prepended_filelist(String filelist_path) {
try {
java.io.BufferedReader reader = new java.io.BufferedReader(new InputStreamReader(new FileInputStream(inputFileName)));
File fl = new File(filelist_path);
BufferedReader reader = new BufferedReader(new FileReader(fl));
List<String> lst = new ArrayList<String>();
for (String l = reader.readLine(); l != null; l = reader.readLine())
lst.add(fileInScratch(l));
reader.close();
List<File> files = new ArrayList<File>();
for (String l = reader.readLine(); l != null; l = reader.readLine()) {
files.add(new File(scratch, l));
}
return commaSeparate(files);
fl.renameTo(new File(fl.getParentFile(), fl.getName() + ".orig"));
File newfl = new File(filelist_path);
newfl.createNewFile();
BufferedWriter writer = new BufferedWriter(new FileWriter(newfl));
for (Iterator<String> iter = lst.iterator(); iter.hasNext();)
writer.write(iter.next() + "\n");
writer.close();
return newfl;
} catch (FileNotFoundException e) {
throw new RuntimeException("File " + inputFileName + " error: " + e);
} catch (java.io.IOException e) {
throw new RuntimeException("File " + inputFileName + " error: " + e);
throw new RuntimeException("File " + filelist_path + " error: " + e);
} catch (IOException e) {
throw new RuntimeException("File " + filelist_path + " error: " + e);
}
}
public void prepare(String size) {
String [] config_args = config.getArgs(size);
args = new String[13];
args[0] = "-filelist";
args[1] = prepended_filelist(fileInScratch(config_args[0].substring(1))).getPath();
args[2] = "-format";
args[3] = "text";
// Java 1.6
args[4] = "-language";
args[5] = "java";
args[6] = "-version";
args[7] = "1.6";
// if this is set to true, PMD will exit with status 4 on finding rule violations.
// however we don't care about rule violations for benchmarking
args[8] = "-failOnViolation";
args[9] = "false";
args[10] = "-shortnames";
args[11] = "-rulesets";
List<String> rulesets = new ArrayList<String>(args.length - 2);
for (int i = 2; i < config_args.length; i ++) {
if (config_args[i].charAt(0) != '-')
rulesets.add(fileInScratch(config_args[i]));
}
args[12] = String.join(",", rulesets);
}
private static String commaSeparate(List<File> list) {
String result = "";
for (Iterator<File> i = list.iterator(); i.hasNext();) {
String s = i.next().getPath();
result += s;
if (i.hasNext())
result += ",";
}
return result;
public void iterate(String size) throws Exception {
method.invoke(null, (Object) args);
}
}
#!/bin/bash
# This script sets up the $HOME/.m2/toolchains.xml if it does not already exist
extract_java_version() {
java -version 2>&1 | grep "version" | sed -E 's/.* version "[0-9]\.([0-9]+).*"/\1/g'
}
if [ ! -e $1 ]; then
jver=$(extract_java_version)
if [ $jver -ge 8 ]; then
cat > $1 <<- EOM
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version> <!-- # though the actual version might be greater, pmd requires 1.7 here. -->
</provides>
<configuration>
<jdkHome>$JAVA_HOME</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.$jver</version>
</provides>
<configuration>
<jdkHome>$JAVA_HOME</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOM
else
echo "PMD benchmark needs Java >= 1.8!" >> /dev/stderr
exit 1
fi
fi
\ No newline at end of file
benchmark pmd
class org.dacapo.harness.Pmd
thread-model single
jars "pmd-4.2.5.jar", "jaxen-1.1.1.jar", "asm-3.1.jar", "junit-3.8.1.jar", "xercesImpl.jar", "xml-apis.jar";
jars "pmd-core-5.7.0.jar", "pmd-java-5.7.0.jar", "jaxen-1.1.6.jar", "asm-5.0.4.jar", "commons-io-2.4.jar", "commons-lang3-3.4.jar", "jcommander-1.48.jar", "saxon-9.1.0.8.jar", "saxon-9.1.0.8-dom.jar", "junit-3.8.1.jar", "xercesImpl.jar", "xml-apis.jar";
size xsmall args "@pmd/small.lst","xml","pmd/rulesets/imports.xml","-debug"
output
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size xsmall args "@pmd/small.lst","text","pmd/rulesets/java/braces.xml","-debug";
size small args "@pmd/small.lst","text",
"pmd/rulesets/basic.xml",
"pmd/rulesets/braces.xml",
"pmd/rulesets/codesize.xml",
"pmd/rulesets/controversial.xml",
"pmd/rulesets/coupling.xml",
"pmd/rulesets/design.xml",
"pmd/rulesets/favorites.xml",
"pmd/rulesets/finalizers.xml",
"pmd/rulesets/imports.xml",
"pmd/rulesets/javabeans.xml",
"pmd/rulesets/junit.xml",
"pmd/rulesets/naming.xml",
"pmd/rulesets/newrules.xml",
"pmd/rulesets/rulesets.properties",
"pmd/rulesets/scratchpad.xml",
"pmd/rulesets/strictexception.xml",
"pmd/rulesets/strings.xml",
"pmd/rulesets/unusedcode.xml"
"pmd/rulesets/java/basic.xml",
"pmd/rulesets/java/braces.xml",
"pmd/rulesets/java/codesize.xml",
"pmd/rulesets/java/controversial.xml",
"pmd/rulesets/java/design.xml",
"pmd/rulesets/java/finalizers.xml",
"pmd/rulesets/java/imports.xml",
"pmd/rulesets/java/javabeans.xml",
"pmd/rulesets/java/junit.xml",
"pmd/rulesets/java/naming.xml",
"pmd/rulesets/java/strictexception.xml",
"pmd/rulesets/java/strings.xml",
"pmd/rulesets/java/unusedcode.xml"
output
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
stdout digest 0xfb33e383fe2f079d7bfa76f564482c144fee1654;
size default args "@pmd/default.lst","text",
"pmd/rulesets/basic.xml",
"pmd/rulesets/braces.xml",
"pmd/rulesets/codesize.xml",
"pmd/rulesets/controversial.xml",
"pmd/rulesets/coupling.xml",
"pmd/rulesets/design.xml",
"pmd/rulesets/favorites.xml",
"pmd/rulesets/finalizers.xml",
"pmd/rulesets/imports.xml",
"pmd/rulesets/javabeans.xml",
"pmd/rulesets/junit.xml",
"pmd/rulesets/naming.xml",
"pmd/rulesets/newrules.xml",
"pmd/rulesets/rulesets.properties",
"pmd/rulesets/scratchpad.xml",
"pmd/rulesets/strictexception.xml",
"pmd/rulesets/strings.xml",
"pmd/rulesets/unusedcode.xml"
"pmd/rulesets/java/basic.xml",
"pmd/rulesets/java/braces.xml",
"pmd/rulesets/java/codesize.xml",
"pmd/rulesets/java/controversial.xml",
"pmd/rulesets/java/design.xml",
"pmd/rulesets/java/finalizers.xml",
"pmd/rulesets/java/imports.xml",
"pmd/rulesets/java/javabeans.xml",
"pmd/rulesets/java/junit.xml",
"pmd/rulesets/java/naming.xml",
"pmd/rulesets/java/strictexception.xml",
"pmd/rulesets/java/strings.xml",
"pmd/rulesets/java/unusedcode.xml"
output
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
stdout digest 0x134df767dd7cb928f7a8737b673826f0db2e6bf8;
size large args "@pmd/large.lst","text",
"pmd/rulesets/basic.xml",
"pmd/rulesets/braces.xml",
"pmd/rulesets/codesize.xml",
"pmd/rulesets/controversial.xml",
"pmd/rulesets/coupling.xml",
"pmd/rulesets/design.xml",
"pmd/rulesets/favorites.xml",
"pmd/rulesets/finalizers.xml",
"pmd/rulesets/imports.xml",
"pmd/rulesets/javabeans.xml",
"pmd/rulesets/junit.xml",
"pmd/rulesets/naming.xml",
"pmd/rulesets/newrules.xml",
"pmd/rulesets/rulesets.properties",
"pmd/rulesets/scratchpad.xml",
"pmd/rulesets/strictexception.xml",
"pmd/rulesets/strings.xml",
"pmd/rulesets/unusedcode.xml"
"pmd/rulesets/java/basic.xml",
"pmd/rulesets/java/braces.xml",
"pmd/rulesets/java/codesize.xml",
"pmd/rulesets/java/controversial.xml",
"pmd/rulesets/java/design.xml",
"pmd/rulesets/java/finalizers.xml",
"pmd/rulesets/java/imports.xml",
"pmd/rulesets/java/javabeans.xml",
"pmd/rulesets/java/junit.xml",
"pmd/rulesets/java/naming.xml",
"pmd/rulesets/java/strictexception.xml",
"pmd/rulesets/java/strings.xml",
"pmd/rulesets/java/unusedcode.xml"
output
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
stdout digest 0x6ffbc6a2e901c82c0ecfca92eb84998db5ea51fc;
description
short "A source code analyzer for Java",
......@@ -79,7 +62,7 @@ description
copyright "Copyright (c) 2003, InfoEther, LLC",
author "Tom Copeland",
license "BSD-style",
url "http://pmd.sourceforge.net/",
version "4.2.5",
url "https://pmd.github.io",
version "5.7.0",
threads "Externally single-threaded. Internally multi-threaded; creating workers according to number of available processors.",
repeats "Single iteration checks numerous sources file against 18 coding rules";
diff -N -u -r pmd.orig/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/CharStream.java pmd/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/CharStream.java
--- pmd.orig/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/CharStream.java 2006-02-10 09:26:30.000000000 +1100
+++ pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/CharStream.java 2006-10-24 09:26:20.000000000 +1000
@@ -1,7 +1,7 @@
/* Generated By:JavaCC: Do not edit this line. CharStream.java Version 3.0 */
/**
* JSP Parser for PMD.
- * @author Pieter Application Engineers NV/SA http://www.ae.be
+ * @author Pieter C Application Engineers NV/SA C http://www.ae.be
*/
package net.sourceforge.pmd.jsp.ast;
diff -N -u -r pmd.orig/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/ParseException.java pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/ParseException.java
--- pmd.orig/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/ParseException.java 2006-02-10 09:26:30.000000000 +1100
+++ pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/ParseException.java 2006-10-24 09:26:20.000000000 +1000
@@ -1,7 +1,7 @@
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
/**
* JSP Parser for PMD.
- * @author Pieter Application Engineers NV/SA http://www.ae.be
+ * @author Pieter C Application Engineers NV/SA C http://www.ae.be
*/
package net.sourceforge.pmd.jsp.ast;
diff -N -u -r pmd.orig/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/Token.java pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/Token.java
--- pmd.orig/pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/Token.java 2006-02-10 09:26:30.000000000 +1100
+++ pmd-4.2.5/src/net/sourceforge/pmd/jsp/ast/Token.java 2006-10-24 09:26:20.000000000 +1000
@@ -1,7 +1,7 @@
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
/**
* JSP Parser for PMD.
- * @author Pieter Application Engineers NV/SA http://www.ae.be
+ * @author Pieter C Application Engineers NV/SA C http://www.ae.be
*/
package net.sourceforge.pmd.jsp.ast;
diff -ur orig/pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java
--- orig/pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java 2017-05-20 20:36:32.000000000 +1000
+++ pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java 2017-12-19 14:30:10.744710417 +1100
@@ -131,7 +131,7 @@
} catch (IOException e) {
throw new IllegalStateException(e);
} finally {
- IOUtils.closeQuietly(writer);
+// IOUtils.closeQuietly(writer);
}
}
}
diff -ur orig/pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/util/datasource/FileDataSource.java pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/util/datasource/FileDataSource.java
index a3691033f..142a10d6e 100644
--- orig/pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/util/datasource/FileDataSource.java
+++ pmd-src-5.7.0/pmd-core/src/main/java/net/sourceforge/pmd/util/datasource/FileDataSource.java
@@ -37,14 +37,19 @@ public class FileDataSource implements DataSource {
}
private String glomName(boolean shortNames, String inputFileName, File file) {
- if (shortNames && inputFileName.indexOf(',') == -1) {
- if (new File(inputFileName).isDirectory()) {
- return trimAnyPathSep(file.getPath().substring(inputFileName.length()));
- } else {
- if (inputFileName.indexOf(FILE_SEPARATOR.charAt(0)) == -1) {
- return inputFileName;
+ if (shortNames) {
+ if (inputFileName != null && inputFileName.indexOf(',') == -1) {
+ if (new File(inputFileName).isDirectory()) {
+ return trimAnyPathSep(file.getPath().substring(inputFileName.length()));
+ } else {
+ if (inputFileName.indexOf(FILE_SEPARATOR.charAt(0)) == -1) {
+ return inputFileName;
+ }
+ return trimAnyPathSep(inputFileName.substring(inputFileName.lastIndexOf(FILE_SEPARATOR)));