Commit 99dbf6a2 authored by Eric Bruneton's avatar Eric Bruneton

Fix some code style issues found with CheckStyle, plus a few others.

parent 821353b6
Pipeline #479 passed with stage
in 10 minutes and 38 seconds
......@@ -124,7 +124,7 @@ public abstract class AsmTest {
private final String name;
private PrecompiledClass(String name) {
PrecompiledClass(final String name) {
this.name = name;
}
......@@ -146,7 +146,7 @@ public abstract class AsmTest {
* @param api an ASM API version.
* @return whether this class was compiled with a JDK which is more recent than api.
*/
public boolean isMoreRecentThan(Api api) {
public boolean isMoreRecentThan(final Api api) {
if (name.startsWith("jdk8") && api.value() < Api.ASM5.value()) {
return true;
}
......@@ -201,7 +201,7 @@ public abstract class AsmTest {
private final String name;
private InvalidClass(String name) {
InvalidClass(final String name) {
this.name = name;
}
......@@ -225,7 +225,7 @@ public abstract class AsmTest {
private final String name;
private final int value;
private Api(String name, int value) {
Api(final String name, final int value) {
this.name = name;
this.value = value;
}
......@@ -273,7 +273,7 @@ public abstract class AsmTest {
return classesAndApis(Api.ASM6);
}
private static Stream<Arguments> classesAndApis(Api... apis) {
private static Stream<Arguments> classesAndApis(final Api... apis) {
return Arrays.stream(PrecompiledClass.values())
.flatMap(
precompiledClass ->
......@@ -286,7 +286,7 @@ public abstract class AsmTest {
* @param classFile the content of a class.
* @return the {@link ClassSubject} to use to make actual assertions about the given class.
*/
public static ClassSubject assertThatClass(byte[] classFile) {
public static ClassSubject assertThatClass(final byte[] classFile) {
return new ClassSubject(classFile);
}
......@@ -295,7 +295,7 @@ public abstract class AsmTest {
/** The content of the class to be tested. */
private final byte[] classFile;
ClassSubject(byte[] classFile) {
ClassSubject(final byte[] classFile) {
this.classFile = classFile;
}
......@@ -305,7 +305,7 @@ public abstract class AsmTest {
*
* @param expectedString a string which should be contained in a dump of the subject class.
*/
public void contains(String expectedString) {
public void contains(final String expectedString) {
try {
String dump = new ClassDump(classFile).toString();
assertTrue(dump.contains(expectedString));
......@@ -321,7 +321,7 @@ public abstract class AsmTest {
*
* @param expectedClassFile a class file content which should be equal to the subject class.
*/
public void isEqualTo(byte[] expectedClassFile) {
public void isEqualTo(final byte[] expectedClassFile) {
try {
String dump = new ClassDump(classFile).toString();
String expectedDump = new ClassDump(expectedClassFile).toString();
......@@ -341,7 +341,7 @@ public abstract class AsmTest {
* @param classContent the content of the class to load.
* @return whether the class was loaded successfully.
*/
public static boolean loadAndInstantiate(String className, byte[] classContent) {
public static boolean loadAndInstantiate(final String className, final byte[] classContent) {
try {
new ClassDump(classContent);
} catch (IOException | IllegalArgumentException e) {
......@@ -359,7 +359,7 @@ public abstract class AsmTest {
* @param classContent the content of the class to load.
* @return whether the class was loaded successfully.
*/
static boolean doLoadAndInstantiate(String className, byte[] classContent) {
static boolean doLoadAndInstantiate(final String className, final byte[] classContent) {
ByteClassLoader byteClassLoader = new ByteClassLoader(className, classContent);
try {
Class<?> clazz = byteClassLoader.loadClass(className);
......@@ -393,7 +393,7 @@ public abstract class AsmTest {
private final byte[] classContent;
private boolean classLoaded;
ByteClassLoader(String className, byte[] classContent) {
ByteClassLoader(final String className, final byte[] classContent) {
this.className = className;
this.classContent = classContent;
}
......@@ -403,7 +403,7 @@ public abstract class AsmTest {
}
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
protected Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
if (name.equals(className)) {
classLoaded = true;
return defineClass(className, classContent, 0, classContent.length);
......@@ -413,7 +413,7 @@ public abstract class AsmTest {
}
}
private static byte[] getBytes(String name) {
private static byte[] getBytes(final String name) {
String resourceName = name.replace('.', '/') + ".class";
try (InputStream inputStream = ClassLoader.getSystemResourceAsStream(resourceName)) {
assertNotNull(inputStream, "Class not found " + name);
......
......@@ -42,7 +42,7 @@ public final class Assertions {
private Assertions() {}
public static ExecutableSubject assertThat(Executable executable) {
public static ExecutableSubject assertThat(final Executable executable) {
return new ExecutableSubject(executable);
}
......@@ -54,7 +54,7 @@ public final class Assertions {
}
public <T extends Throwable> ExecutableOutcomeSubject<T> succeedsOrThrows(
Class<T> expectedType) {
final Class<T> expectedType) {
return new ExecutableOutcomeSubject<>(executable, expectedType);
}
}
......@@ -68,7 +68,7 @@ public final class Assertions {
this.expectedType = expectedType;
}
public void when(boolean condition) {
public void when(final boolean condition) {
if (condition) {
assertThrows(expectedType, executable);
} else {
......
......@@ -58,65 +58,67 @@ import org.objectweb.asm.Opcodes;
public class DumpArtificialStructures implements Opcodes {
public static void main(String[] args) throws IOException {
FileOutputStream fos = new FileOutputStream("ArtificialStructures.class");
fos.write(dump());
fos.close();
FileOutputStream fileOutputStream = new FileOutputStream("ArtificialStructures.class");
fileOutputStream.write(dump());
fileOutputStream.close();
}
private static byte[] dump() {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
FieldVisitor fv;
MethodVisitor mv;
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
FieldVisitor fieldVisitor;
MethodVisitor methodVisitor;
cw.visit(
classWriter.visit(
V1_3, ACC_PUBLIC + ACC_SUPER, "jdk3/ArtificialStructures", null, "java/lang/Object", null);
cw.visitSource("ArtificialStructures.java", "source-debug");
classWriter.visitSource("ArtificialStructures.java", "source-debug");
cw.visitAttribute(new Comment());
classWriter.visitAttribute(new Comment());
fv = cw.visitField(ACC_PUBLIC + ACC_SYNTHETIC, "f", "I", null, null);
fv.visitAttribute(new Comment());
fv.visitEnd();
fieldVisitor = classWriter.visitField(ACC_PUBLIC + ACC_SYNTHETIC, "f", "I", null, null);
fieldVisitor.visitAttribute(new Comment());
fieldVisitor.visitEnd();
mv = cw.visitMethod(ACC_PUBLIC + ACC_SYNTHETIC, "<init>", "(Ljava/lang/String;)V", null, null);
mv.visitAttribute(new Comment());
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
mv.visitInsn(NOP);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitAttribute(new CodeComment());
mv.visitEnd();
methodVisitor =
classWriter.visitMethod(
ACC_PUBLIC + ACC_SYNTHETIC, "<init>", "(Ljava/lang/String;)V", null, null);
methodVisitor.visitAttribute(new Comment());
methodVisitor.visitCode();
methodVisitor.visitVarInsn(ALOAD, 0);
methodVisitor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
methodVisitor.visitInsn(NOP);
methodVisitor.visitInsn(RETURN);
methodVisitor.visitMaxs(0, 0);
methodVisitor.visitAttribute(new CodeComment());
methodVisitor.visitEnd();
mv = cw.visitMethod(0, "<init>", "(Z)V", null, null);
mv.visitCode();
mv.visitVarInsn(ILOAD, 1);
mv.visitVarInsn(ALOAD, 0);
mv.visitInsn(SWAP);
methodVisitor = classWriter.visitMethod(0, "<init>", "(Z)V", null, null);
methodVisitor.visitCode();
methodVisitor.visitVarInsn(ILOAD, 1);
methodVisitor.visitVarInsn(ALOAD, 0);
methodVisitor.visitInsn(SWAP);
Label elseLabel = new Label();
mv.visitJumpInsn(IFEQ, elseLabel);
mv.visitLdcInsn("1");
methodVisitor.visitJumpInsn(IFEQ, elseLabel);
methodVisitor.visitLdcInsn("1");
Label endIfLabel = new Label();
mv.visitJumpInsn(GOTO, endIfLabel);
mv.visitLabel(elseLabel);
mv.visitLineNumber(1, elseLabel);
mv.visitLineNumber(3, elseLabel);
mv.visitLdcInsn("0");
mv.visitLabel(endIfLabel);
mv.visitLineNumber(5, endIfLabel);
mv.visitLineNumber(7, endIfLabel);
mv.visitLineNumber(11, endIfLabel);
mv.visitLineNumber(13, endIfLabel);
mv.visitLineNumber(17, endIfLabel);
mv.visitMethodInsn(
methodVisitor.visitJumpInsn(GOTO, endIfLabel);
methodVisitor.visitLabel(elseLabel);
methodVisitor.visitLineNumber(1, elseLabel);
methodVisitor.visitLineNumber(3, elseLabel);
methodVisitor.visitLdcInsn("0");
methodVisitor.visitLabel(endIfLabel);
methodVisitor.visitLineNumber(5, endIfLabel);
methodVisitor.visitLineNumber(7, endIfLabel);
methodVisitor.visitLineNumber(11, endIfLabel);
methodVisitor.visitLineNumber(13, endIfLabel);
methodVisitor.visitLineNumber(17, endIfLabel);
methodVisitor.visitMethodInsn(
INVOKESPECIAL, "jdk3/ArtificialStructures", "<init>", "(Ljava/lang/String;)V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
methodVisitor.visitInsn(RETURN);
methodVisitor.visitMaxs(0, 0);
methodVisitor.visitEnd();
cw.visitEnd();
return cw.toByteArray();
classWriter.visitEnd();
return classWriter.toByteArray();
}
}
......@@ -46,7 +46,7 @@ public class AsmTestTest extends AsmTest {
/** Tests the isMoreRecentThan method. */
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_ALL_APIS)
public void testIsMoreRecentThan(PrecompiledClass classParameter, Api apiParameter) {
public void testIsMoreRecentThan(final PrecompiledClass classParameter, final Api apiParameter) {
byte[] classContent = classParameter.getBytes();
int majorVersion = (classContent[6] & 0xFF) << 8 | (classContent[7] & 0xFF);
boolean isMoreRecent = classParameter.isMoreRecentThan(apiParameter);
......@@ -68,7 +68,7 @@ public class AsmTestTest extends AsmTest {
/** Tests that we can get the byte array content of each precompiled class. */
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_LATEST_API)
public void testGetBytes(PrecompiledClass classParameter, Api apiParameter) {
public void testGetBytes(final PrecompiledClass classParameter, final Api apiParameter) {
assertEquals(Api.ASM6, apiParameter);
assertEquals(0x00060000, apiParameter.value());
assertEquals("ASM6", apiParameter.toString());
......@@ -80,7 +80,7 @@ public class AsmTestTest extends AsmTest {
/** Tests that we can load (and instantiate) each (non-abstract) precompiled class. */
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_LATEST_API)
public void testLoadAndInstantiate(PrecompiledClass classParameter, Api apiParameter) {
public void testLoadAndInstantiate(final PrecompiledClass classParameter, final Api apiParameter) {
assertThat(() -> loadAndInstantiate(classParameter.getName(), classParameter.getBytes()))
.succeedsOrThrows(UnsupportedClassVersionError.class)
.when(classParameter.isMoreRecentThanCurrentJdk());
......@@ -92,7 +92,7 @@ public class AsmTestTest extends AsmTest {
*/
@ParameterizedTest
@EnumSource(InvalidClass.class)
public void testLoadAndInstantiate_invalidClass(InvalidClass invalidClass) {
public void testLoadAndInstantiate_invalidClass(final InvalidClass invalidClass) {
byte[] classContent = invalidClass.getBytes();
assertThrows(
AssertionError.class, () -> loadAndInstantiate(invalidClass.toString(), classContent));
......@@ -104,7 +104,7 @@ public class AsmTestTest extends AsmTest {
*/
@ParameterizedTest
@EnumSource(InvalidClass.class)
public void testDoLoadAndInstantiate_invalidClass(InvalidClass invalidClass) {
public void testDoLoadAndInstantiate_invalidClass(final InvalidClass invalidClass) {
byte[] classContent = invalidClass.getBytes();
switch (invalidClass) {
case INVALID_ELEMENT_VALUE:
......
......@@ -170,7 +170,7 @@ public abstract class AbstractInsnNode {
*
* @param methodVisitor a method visitor.
*/
public abstract void accept(final MethodVisitor methodVisitor);
public abstract void accept(MethodVisitor methodVisitor);
/**
* Makes the given visitor visit the annotations of this instruction.
......@@ -203,7 +203,7 @@ public abstract class AbstractInsnNode {
* @return a copy of this instruction. The returned instruction does not belong to any {@link
* InsnList}.
*/
public abstract AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels);
public abstract AbstractInsnNode clone(Map<LabelNode, LabelNode> clonedLabels);
/**
* Returns the clone of the given label.
......
......@@ -32,7 +32,6 @@ import java.util.Map;
import org.objectweb.asm.Handle;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
/**
* A node that represents an invokedynamic instruction.
......@@ -57,12 +56,12 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode {
* Constructs a new {@link InvokeDynamicInsnNode}.
*
* @param name the method's name.
* @param descriptor the method's descriptor (see {@link Type Type}).
* @param descriptor the method's descriptor (see {@link org.objectweb.asm.Type}).
* @param bootstrapMethodHandle the bootstrap method.
* @param bootstrapMethodArguments the bootstrap method constant arguments. Each argument must be
* an {@link Integer}, {@link Float}, {@link Long}, {@link Double}, {@link String}, {@link
* Type} or {@link Handle} value. This method is allowed to modify the content of the array so
* a caller should expect that this array may change.
* org.objectweb.asm.Type} or {@link Handle} value. This method is allowed to modify the
* content of the array so a caller should expect that this array may change.
*/
public InvokeDynamicInsnNode(
final String name,
......
......@@ -34,7 +34,6 @@ import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.TypePath;
import org.objectweb.asm.TypeReference;
/**
* A node that represents a type annotation on a local or resource variable.
......@@ -67,7 +66,7 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode {
* constructor</i>. Instead, they must use the {@link #LocalVariableAnnotationNode(int, TypePath,
* LabelNode[], LabelNode[], int[], String)} version.
*
* @param typeRef a reference to the annotated type. See {@link TypeReference}.
* @param typeRef a reference to the annotated type. See {@link org.objectweb.asm.TypeReference}.
* @param typePath the path to the annotated type argument, wildcard bound, array element type, or
* static inner type within 'typeRef'. May be <tt>null</tt> if the annotation targets
* 'typeRef' as a whole.
......@@ -80,12 +79,12 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode {
* @param descriptor the class descriptor of the annotation class.
*/
public LocalVariableAnnotationNode(
int typeRef,
TypePath typePath,
LabelNode[] start,
LabelNode[] end,
int[] index,
String descriptor) {
final int typeRef,
final TypePath typePath,
final LabelNode[] start,
final LabelNode[] end,
final int[] index,
final String descriptor) {
this(Opcodes.ASM6, typeRef, typePath, start, end, index, descriptor);
}
......@@ -94,7 +93,7 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode {
*
* @param api the ASM API version implemented by this visitor. Must be one of {@link
* Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
* @param typeRef a reference to the annotated type. See {@link TypeReference}.
* @param typeRef a reference to the annotated type. See {@link org.objectweb.asm.TypeReference}.
* @param start the fist instructions corresponding to the continuous ranges that make the scope
* of this local variable (inclusive).
* @param end the last instructions corresponding to the continuous ranges that make the scope of
......@@ -107,13 +106,13 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode {
* @param descriptor the class descriptor of the annotation class.
*/
public LocalVariableAnnotationNode(
int api,
int typeRef,
TypePath typePath,
LabelNode[] start,
LabelNode[] end,
int[] index,
String descriptor) {
final int api,
final int typeRef,
final TypePath typePath,
final LabelNode[] start,
final LabelNode[] end,
final int[] index,
final String descriptor) {
super(api, typeRef, typePath, descriptor);
this.start = Util.asArrayList(start);
this.end = Util.asArrayList(end);
......@@ -126,7 +125,7 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode {
* @param methodVisitor the visitor that must visit this annotation.
* @param visible <tt>true</tt> if the annotation is visible at runtime.
*/
public void accept(final MethodVisitor methodVisitor, boolean visible) {
public void accept(final MethodVisitor methodVisitor, final boolean visible) {
Label[] startLabels = new Label[this.start.size()];
Label[] endLabels = new Label[this.end.size()];
int[] indices = new int[this.index.size()];
......
......@@ -274,7 +274,7 @@ public class MethodNode extends MethodVisitor {
@Override
public AnnotationVisitor visitTypeAnnotation(
int typeRef, TypePath typePath, String descriptor, boolean visible) {
final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
TypeAnnotationNode typeAnnotation = new TypeAnnotationNode(typeRef, typePath, descriptor);
if (visible) {
if (visibleTypeAnnotations == null) {
......@@ -487,7 +487,7 @@ public class MethodNode extends MethodVisitor {
@Override
public AnnotationVisitor visitTryCatchAnnotation(
int typeRef, TypePath typePath, String descriptor, boolean visible) {
final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
TryCatchBlockNode tryCatchBlock = tryCatchBlocks.get((typeRef & 0x00FFFF00) >> 8);
TypeAnnotationNode typeAnnotation = new TypeAnnotationNode(typeRef, typePath, descriptor);
if (visible) {
......@@ -639,8 +639,8 @@ public class MethodNode extends MethodVisitor {
throw new UnsupportedClassVersionException();
}
if (insn instanceof MethodInsnNode) {
boolean itf = ((MethodInsnNode) insn).itf;
if (itf != (insn.opcode == Opcodes.INVOKEINTERFACE)) {
boolean isInterface = ((MethodInsnNode) insn).itf;
if (isInterface != (insn.opcode == Opcodes.INVOKEINTERFACE)) {
throw new UnsupportedClassVersionException();
}
}
......
......@@ -37,7 +37,7 @@ import org.objectweb.asm.ModuleVisitor;
* @author Remi Forax
*/
public class ModuleProvideNode {
/** The internal name of the service. */
public String service;
......
......@@ -35,7 +35,7 @@ import org.objectweb.asm.MethodVisitor;
* @author Remi Forax
*/
public class ParameterNode {
/** The parameter's name. */
public String name;
......
......@@ -29,7 +29,6 @@ package org.objectweb.asm.tree;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.TypePath;
import org.objectweb.asm.TypeReference;
/**
* A node that represents a type annotation.
......@@ -38,7 +37,7 @@ import org.objectweb.asm.TypeReference;
*/
public class TypeAnnotationNode extends AnnotationNode {
/** A reference to the annotated type. See {@link TypeReference}. */
/** A reference to the annotated type. See {@link org.objectweb.asm.TypeReference}. */
public int typeRef;
/**
......@@ -52,7 +51,7 @@ public class TypeAnnotationNode extends AnnotationNode {
* Constructs a new {@link AnnotationNode}. <i>Subclasses must not use this constructor</i>.
* Instead, they must use the {@link #TypeAnnotationNode(int, int, TypePath, String)} version.
*
* @param typeRef a reference to the annotated type. See {@link TypeReference}.
* @param typeRef a reference to the annotated type. See {@link org.objectweb.asm.TypeReference}.
* @param typePath the path to the annotated type argument, wildcard bound, array element type, or
* static inner type within 'typeRef'. May be <tt>null</tt> if the annotation targets
* 'typeRef' as a whole.
......@@ -71,7 +70,7 @@ public class TypeAnnotationNode extends AnnotationNode {
*
* @param api the ASM API version implemented by this visitor. Must be one of {@link
* Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
* @param typeRef a reference to the annotated type. See {@link TypeReference}.
* @param typeRef a reference to the annotated type. See {@link org.objectweb.asm.TypeReference}.
* @param typePath the path to the annotated type argument, wildcard bound, array element type, or
* static inner type within 'typeRef'. May be <tt>null</tt> if the annotation targets
* 'typeRef' as a whole.
......
......@@ -85,7 +85,7 @@ public class ClassNodeTest extends AsmTest implements Opcodes {
moduleNode.accept(
new ClassVisitor(Opcodes.ASM6) {
@Override
public ModuleVisitor visitModule(String name, int access, String version) {
public ModuleVisitor visitModule(final String name, final int access, final String version) {
return otherModuleNode;
}
});
......@@ -331,7 +331,7 @@ public class ClassNodeTest extends AsmTest implements Opcodes {
/** Tests that classes are unchanged with a ClassReader->ClassNode->ClassWriter transform. */
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_ALL_APIS)
public void testReadAndWrite(PrecompiledClass classParameter, Api apiParameter) {
public void testReadAndWrite(final PrecompiledClass classParameter, final Api apiParameter) {
byte[] classFile = classParameter.getBytes();
ClassReader classReader = new ClassReader(classFile);
ClassNode classNode = new ClassNode(apiParameter.value());
......@@ -348,7 +348,7 @@ public class ClassNodeTest extends AsmTest implements Opcodes {
*/
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_ALL_APIS)
public void testCheck(PrecompiledClass classParameter, Api apiParameter) {
public void testCheck(final PrecompiledClass classParameter, final Api apiParameter) {
byte[] classFile = classParameter.getBytes();
ClassReader classReader = new ClassReader(classFile);
ClassNode classNode = new ClassNode(apiParameter.value());
......@@ -365,7 +365,7 @@ public class ClassNodeTest extends AsmTest implements Opcodes {
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_ALL_APIS)
@SuppressWarnings("serial")
public void testReadCloneAndWrite(PrecompiledClass classParameter, Api apiParameter) {
public void testReadCloneAndWrite(final PrecompiledClass classParameter, final Api apiParameter) {
byte[] classFile = classParameter.getBytes();
ClassReader classReader = new ClassReader(classFile);
ClassNode classNode = new ClassNode(apiParameter.value());
......@@ -393,7 +393,7 @@ public class ClassNodeTest extends AsmTest implements Opcodes {
/** Tests that ClassNode accepts visitors that remove class elements. */
@ParameterizedTest
@MethodSource(ALL_CLASSES_AND_ALL_APIS)
public void testRemoveMembers(PrecompiledClass classParameter, Api apiParameter) {
public void testRemoveMembers(final PrecompiledClass classParameter, final Api apiParameter) {
byte[] classFile = classParameter.getBytes();
ClassReader classReader = new ClassReader(classFile);
ClassNode classNode = new ClassNode(apiParameter.value());
......@@ -412,39 +412,39 @@ public class ClassNodeTest extends AsmTest implements Opcodes {
private static class RemoveMembersClassVisitor extends ClassVisitor {
RemoveMembersClassVisitor(int api, ClassVisitor classVisitor) {
RemoveMembersClassVisitor(final int api, final ClassVisitor classVisitor) {
super(api, classVisitor);
}
@Override
public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
return null;
}
@Override
public AnnotationVisitor visitTypeAnnotation(
int typeRef, TypePath typePath, String descriptor, boolean visible) {
final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
return null;
}
@Override
public FieldVisitor visitField(
int access, String name, String descriptor, String signature, Object value) {
final int access, final String name, final String descriptor, final String signature, final Object value) {
return null;
}
@Override
public MethodVisitor visitMethod(
int access, String name, String descriptor, String signature, String[] exceptions) {
final int access, final String name, final String descriptor, final String signature, final String[] exceptions) {
return null;
}
@Override
public ModuleVisitor visitModule(String name, int access, String version) {
public ModuleVisitor visitModule(final String name, final int access, final String version) {
return null;
}
@Override
public void visitAttribute(Attribute attribute) {}
public void visitAttribute(final Attribute attribute) {}
}
}
......@@ -74,10 +74,4 @@ public class CodeComment extends Attribute {
final int maxLocals) {
return new ByteVector();
}
@Override
protected Label[] getLabels() {
super.getLabels();
return new Label[] {new Label()};
}
}
......@@ -704,7 +704,7 @@ public class InsnListTest {
list1.add(new InsnNode(0));
list1.add(insn);
list1.add(new InsnNode(0));
list1.clear();
list1.clear();
assertEquals(0, list1.size());
assertEquals(null, list1.getFirst());
assertEquals(null, list1.getLast());
......@@ -723,7 +723,7 @@ public class InsnListTest {
list1.accept(
new MethodVisitor(Opcodes.ASM6) {
@Override
public void visitInsn(int opcode) {
public void visitInsn(final int opcode) {
insnList.add(new InsnNode(opcode));
}
});
......
......@@ -88,7 +88,7 @@ public class ByteVector {
* @param byteValue2 another byte.
* @return this byte vector.
*/
ByteVector put11(final int byteValue1, final int byteValue2) {
final ByteVector put11(final int byteValue1, final int byteValue2) {
int currentLength = length;
if (currentLength + 2 > data.length) {
enlarge(2);
......@@ -126,7 +126,7 @@ public class ByteVector {
* @param shortValue a short.
* @return this byte vector.
*/
ByteVector put12(final int byteValue, final int shortValue) {
final ByteVector put12(final int byteValue, final int shortValue) {
int currentLength = length;
if (currentLength + 3 > data.length) {
enlarge(3);
......@@ -148,7 +148,7 @@ public class ByteVector {
* @param shortValue a short.
* @return this byte vector.
*/
ByteVector put112(final int byteValue1, final int byteValue2, final int shortValue) {
final ByteVector put112(final int byteValue1, final int byteValue2, final int shortValue) {
int currentLength = length;
if (currentLength + 4 > data.length) {
enlarge(4);
......@@ -191,7 +191,7 @@ public class ByteVector {
* @param shortValue2 another short.
* @return this byte vector.
*/
ByteVector put122(final int byteValue, final int shortValue1, final int shortValue2) {
final ByteVector put122(final int byteValue, final int shortValue1, final int shortValue2) {
int currentLength = length;
if (currentLength + 5 > data.length) {
enlarge(5);
......@@ -280,7 +280,7 @@ public class ByteVector {
* encoded characters.
* @return this byte vector.
*/
ByteVector encodeUTF8(final String stringValue, final int offset, final int maxByteLength) {
final ByteVector encodeUTF8(final String stringValue, final int offset, final int maxByteLength) {
int charLength = stringValue.length();
int byteLength = offset;
for (int i = offset; i < charLength; ++i) {
......
......@@ -241,7 +241,7 @@ public class ClassReader {