Commit 7fbb796a authored by Eric Bruneton's avatar Eric Bruneton

Update the version number and fix the last PMD warnings.

parent a3d1672f
Pipeline #2992 passed with stage
in 8 minutes and 19 seconds
......@@ -47,6 +47,6 @@ class SerialVersionClass implements Serializable { // NOPMD(MissingSerialVersion
SerialVersionClass() {}
public Object[] someMethod() {
return null;
return new Object[0];
}
}
......@@ -66,7 +66,7 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode {
final String name,
final String descriptor,
final Handle bootstrapMethodHandle,
final Object... bootstrapMethodArguments) {
final Object... bootstrapMethodArguments) { // NOPMD(ArrayIsStoredDirectly): public field.
super(Opcodes.INVOKEDYNAMIC);
this.name = name;
this.desc = descriptor;
......
......@@ -949,7 +949,7 @@ public class CheckClassAdapter extends ClassVisitor {
*/
public static void main(final String[] args) throws IOException {
if (args.length != 1) {
System.err.println( // NOPMD(SystemPrintln): main method.
System.err.println(
"Verifies the given class.\n"
+ "Usage: CheckClassAdapter <fully qualified class name or class file name>");
return;
......
......@@ -1225,7 +1225,7 @@ public abstract class Printer {
static void main(final String usage, final Printer printer, final String[] args)
throws IOException {
if (args.length < 1 || args.length > 2 || (args[0].equals("-debug") && args.length != 2)) {
System.err.println(usage); // NOPMD(SystemPrintln): main method.
System.err.println(usage);
return;
}
......
......@@ -134,7 +134,10 @@ public abstract class Adapter {
* @param interfaces the internal names of the class's interfaces
*/
public ClassInfo(
final int access, final String name, final String superClass, final String[] interfaces) {
final int access,
final String name,
final String superClass,
final String[] interfaces) { // NOPMD(ArrayIsStoredDirectly): non public API.
this.access = access;
this.name = name;
this.superClass = superClass;
......
......@@ -44,7 +44,7 @@ subprojects {
apply plugin: 'jacoco'
def snapshotSuffix = rootProject.hasProperty('release') ? '' : '-SNAPSHOT'
group = 'org.ow2.asm'
version = '7.0-beta' + snapshotSuffix
version = '7.0' + snapshotSuffix
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
test { useJUnitPlatform() }
......@@ -180,9 +180,6 @@ subprojects {
pmd.toolVersion = '6.5.0'
pmd.ruleSets = []
pmd.ruleSetFiles = files("${rootDir}/tools/pmd.xml")
// TODO remove these lines when the code is fixed.
pmd.ignoreFailures = true
pmd.consoleOutput = true
compileTestJava {
sourceCompatibility = '1.8'
......
......@@ -49,6 +49,27 @@
<!-- Too many false positives. -->
<exclude name="UseVarargs" />
</rule>
<rule ref="category/java/bestpractices.xml/ArrayIsStoredDirectly">
<properties>
<property name="violationSuppressXPath"
value="//MethodDeclaration[@Private='true' or
@PackagePrivate='true']"/>
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/MethodReturnsInternalArray">
<properties>
<property name="violationSuppressXPath"
value="//MethodDeclaration[@Private='true' or
@PackagePrivate='true']"/>
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/SystemPrintln">
<properties>
<property name="violationSuppressXPath"
value="//MethodDeclaration[@Static='true']
//MethodDeclarator[@Image='main']"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml">
<!-- Do not want this rule. -->
......@@ -87,6 +108,12 @@
<exclude name="StaticEJBFieldShouldBeFinal" />
<exclude name="UseProperClassLoader" />
</rule>
<rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull">
<properties>
<property name="violationSuppressXPath"
value="//MethodDeclaration[@Private='true']"/>
</properties>
</rule>
<rule ref="category/java/performance.xml">
<!-- Too many false positives. -->
......
......@@ -120,8 +120,8 @@ public class Retrofitter {
if (files == null) {
throw new IOException("Unable to read files of " + src);
}
for (int i = 0; i < files.length; ++i) {
retrofit(files[i], dst == null ? null : new File(dst, files[i].getName()));
for (File file : files) {
retrofit(file, dst == null ? null : new File(dst, file.getName()));
}
} else if (src.getName().endsWith(".class")) {
if (dst == null || !dst.exists() || dst.lastModified() < src.lastModified()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment