Commit 4e53f33b authored by ebruneton's avatar ebruneton
Browse files

- Update the product version to 5.0 beta

- Fix a few "bugs" found with Findbugs
- Switch to JDK 8 to run the tests.
parent 0cef6b8b
......@@ -31,7 +31,7 @@
# Some information about the product
product.name asm
product.version 5.0_ALPHA
product.version 5.0_BETA
# product.snapshot yes
plugin.version 3.3.0
......
......@@ -189,7 +189,7 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
// ------------------------------------------------------------------------
// Overriden methods
// Overridden methods
// ------------------------------------------------------------------------
/*
......@@ -205,7 +205,7 @@ public class SerialVersionUIDAdder extends ClassVisitor {
if (computeSVUID) {
this.name = name;
this.access = access;
this.interfaces = interfaces;
this.interfaces = Arrays.copyOf(interfaces, interfaces.length);
}
super.visit(version, access, name, signature, superName, interfaces);
......
......@@ -217,7 +217,7 @@ public class CheckClassAdapter extends ClassVisitor {
List<Type> interfaces = new ArrayList<Type>();
for (Iterator<String> i = cn.interfaces.iterator(); i.hasNext();) {
interfaces.add(Type.getObjectType(i.next().toString()));
interfaces.add(Type.getObjectType(i.next()));
}
for (int i = 0; i < methods.size(); ++i) {
......
......@@ -113,25 +113,26 @@ public final class SAXAnnotationAdapter extends AnnotationVisitor {
typePath.toString());
}
if (start != null) {
String value = start[0];
StringBuffer value = new StringBuffer(start[0]);
for (int i = 1; i < start.length; ++i) {
value = value + " " + start[i];
value.append(" ").append(start[i]);
}
att.addAttribute("", "start", "start", "", value);
att.addAttribute("", "start", "start", "", value.toString());
}
if (end != null) {
String value = end[0];
StringBuffer value = new StringBuffer(end[0]);
for (int i = 1; i < end.length; ++i) {
value = value + " " + end[i];
value.append(" ").append(end[i]);
}
att.addAttribute("", "end", "end", "", value);
att.addAttribute("", "end", "end", "", value.toString());
}
if (index != null) {
String value = Integer.toString(index[0]);
StringBuffer value = new StringBuffer();
value.append(index[0]);
for (int i = 1; i < index.length; ++i) {
value = value + " " + Integer.toString(index[i]);
value.append(" ").append(index[i]);
}
att.addAttribute("", "index", "index", "", value);
att.addAttribute("", "index", "index", "", value.toString());
}
sa.addStart(elementName, att);
......
......@@ -43,7 +43,7 @@ import org.objectweb.asm.TypeReference;
/**
* Generates a class with 2 methods with method parameters.
*
*
* @author Remi Forax
*/
public class MethodParameters extends Generator {
......@@ -55,18 +55,13 @@ public class MethodParameters extends Generator {
public byte[] dumpCode() {
ClassWriter cw = new ClassWriter(0);
ClassVisitor cv = cw;
// TODO replace V_7 with V1_8 once we have JDK8.
cv.visit(
V1_7,
ACC_PUBLIC + ACC_ABSTRACT,
"pkg/MethodParameters",
null,
"java/lang/Object",
null);
cv.visit(V1_8, ACC_PUBLIC + ACC_ABSTRACT, "pkg/MethodParameters", null,
"java/lang/Object", null);
// static method
MethodVisitor mv = cv.visitMethod(ACC_PUBLIC + ACC_STATIC, "m",
"(ILjava/lang/Object;Ljava/lang/String;Ljava/lang/Object;I)V", null, null);
"(ILjava/lang/Object;Ljava/lang/String;Ljava/lang/Object;I)V",
null, null);
// parameter 0 type int
mv.visitParameter("i", 0);
......
......@@ -56,9 +56,8 @@ public class TypeAnnotation extends Generator {
public byte[] dumpTypeAnnotations() {
ClassWriter cw = new ClassWriter(0);
ClassVisitor cv = cw;
// TODO replace V_7 with V1_8 once we have JDK8.
cv.visit(
V1_7,
V1_8,
ACC_PUBLIC,
"pkg/TypeAnnotations",
"<E:Lpkg/C;F:Lpkg/D;>Lpkg/S<TE;TF;>;Lpkg/I1<TE;>;Lpkg/I2<TF;>;",
......
Supports Markdown
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