Commit eb9bcb1e authored by Eric Bruneton's avatar Eric Bruneton

Add the FinalClass checkstyle module. Make the Type class final. To not break...

Add the FinalClass checkstyle module. Make the Type class final. To not break the signature tests despite this (theorically) backward incompatible change, it is necessary to do as if Type has always been final.
parent 0cae8ffa
Pipeline #2883 passed with stage
in 6 minutes and 42 seconds
......@@ -39,5 +39,7 @@ class SerialVersionAnonymousInnerClass implements Serializable {
public static final SerialVersionAnonymousInnerClass anonymousInnerClass =
new SerialVersionAnonymousInnerClass() {};
private SerialVersionAnonymousInnerClass() {}
SerialVersionAnonymousInnerClass() {}
public void someMethod() {}
}
......@@ -41,9 +41,9 @@ class SerialVersionClass implements Serializable {
static {
}
private SerialVersionClass() {}
SerialVersionClass() {}
public static Object[] someMethod() {
public Object[] someMethod() {
return null;
}
}
......@@ -70,7 +70,7 @@ public class SerialVersionUidAdderTest extends AsmTest {
@Test
public void testClass() throws IOException {
long actualSvuid = computeSerialVersionUid(SerialVersionClass.class.getName());
assertEquals(7983131370903707377L, actualSvuid);
assertEquals(1084684350676694225L, actualSvuid);
}
@Test
......
......@@ -37,7 +37,7 @@ import java.lang.reflect.Method;
* @author Eric Bruneton
* @author Chris Nokleberg
*/
public class Type {
public final class Type {
/** The sort of the {@code void} type. See {@link #getSort}. */
public static final int VOID = 0;
......
......@@ -404,7 +404,7 @@ fld public final static java.lang.Integer NULL
fld public final static java.lang.Integer TOP
fld public final static java.lang.Integer UNINITIALIZED_THIS
CLSS public org.objectweb.asm.Type
CLSS public final org.objectweb.asm.Type
fld public final static int ARRAY = 9
fld public final static int BOOLEAN = 1
fld public final static int BYTE = 3
......
......@@ -416,7 +416,7 @@ fld public final static java.lang.Integer NULL
fld public final static java.lang.Integer TOP
fld public final static java.lang.Integer UNINITIALIZED_THIS
CLSS public org.objectweb.asm.Type
CLSS public final org.objectweb.asm.Type
fld public final static int ARRAY = 9
fld public final static int BOOLEAN = 1
fld public final static int BYTE = 3
......
......@@ -419,7 +419,7 @@ fld public final static java.lang.Integer NULL
fld public final static java.lang.Integer TOP
fld public final static java.lang.Integer UNINITIALIZED_THIS
CLSS public org.objectweb.asm.Type
CLSS public final org.objectweb.asm.Type
fld public final static int ARRAY = 9
fld public final static int BOOLEAN = 1
fld public final static int BYTE = 3
......
......@@ -449,7 +449,7 @@ fld public final static java.lang.Integer NULL
fld public final static java.lang.Integer TOP
fld public final static java.lang.Integer UNINITIALIZED_THIS
CLSS public org.objectweb.asm.Type
CLSS public final org.objectweb.asm.Type
fld public final static int ARRAY = 9
fld public final static int BOOLEAN = 1
fld public final static int BYTE = 3
......
......@@ -450,7 +450,7 @@ fld public final static java.lang.Integer NULL
fld public final static java.lang.Integer TOP
fld public final static java.lang.Integer UNINITIALIZED_THIS
CLSS public org.objectweb.asm.Type
CLSS public final org.objectweb.asm.Type
fld public final static int ARRAY = 9
fld public final static int BOOLEAN = 1
fld public final static int BYTE = 3
......
......@@ -473,7 +473,7 @@ fld public final static java.lang.Integer NULL
fld public final static java.lang.Integer TOP
fld public final static java.lang.Integer UNINITIALIZED_THIS
CLSS public org.objectweb.asm.Type
CLSS public final org.objectweb.asm.Type
fld public final static int ARRAY = 9
fld public final static int BOOLEAN = 1
fld public final static int BYTE = 3
......
......@@ -134,6 +134,7 @@
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="FinalClass" />
<module name="FinalParameters" />
<!-- Module allowing to suppress warnings with DontCheck(...) comments. -->
......
......@@ -56,7 +56,7 @@ import org.objectweb.asm.Type;
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public class Retrofitter {
public final class Retrofitter {
/**
* The fields and methods of the JDK 1.5 API. Each string has the form
......
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