Improves pmd jdk8 readiness
* Upgrade asm so that it understands default method and static methods in interfaces jdk8 class files
* see 9b91690f21
for ASM4 support
This commit is contained in:
@ -51,13 +51,13 @@ public class TypeSignatureVisitor extends SignatureVisitor {
|
||||
}
|
||||
|
||||
public TypeSignatureVisitor() {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
p = new PrintVisitor();
|
||||
init();
|
||||
}
|
||||
|
||||
public TypeSignatureVisitor(PrintVisitor parent) {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
p = new PrintVisitor(parent);
|
||||
init();
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class UsageGraphBuilder {
|
||||
}
|
||||
|
||||
public MyClassVisitor() {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
p = new PrintVisitor();
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ public class UsageGraphBuilder {
|
||||
private final MemberNode usingMemberNode;
|
||||
|
||||
public MyMethodVisitor(PrintVisitor parent, MemberNode usingMemberNode) {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
p = parent;
|
||||
this.usingMemberNode = usingMemberNode;
|
||||
}
|
||||
@ -353,13 +353,14 @@ public class UsageGraphBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
|
||||
if (TRACE) {
|
||||
println("visitMethodInsn:");
|
||||
printlnIndent("opcode: " + opcode);
|
||||
printlnIndent("owner: " + owner);
|
||||
printlnIndent("name: " + name);
|
||||
printlnIndent("desc: " + desc);
|
||||
printlnIndent("itf: " + itf);
|
||||
}
|
||||
if (INDEX) {
|
||||
String className = getClassName(owner);
|
||||
|
@ -21,7 +21,7 @@ import org.objectweb.asm.signature.SignatureVisitor;
|
||||
public class PMDASMVisitor extends ClassVisitor {
|
||||
|
||||
public PMDASMVisitor() {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
}
|
||||
|
||||
private Map<String, String> packages = new HashMap<String, String>();
|
||||
@ -173,7 +173,7 @@ public class PMDASMVisitor extends ClassVisitor {
|
||||
private PMDASMVisitor parent;
|
||||
|
||||
public PMDFieldVisitor(PMDASMVisitor visitor) {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
parent = visitor;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ public class PMDASMVisitor extends ClassVisitor {
|
||||
private PMDASMVisitor parent;
|
||||
|
||||
public PMDAnnotationVisitor(PMDASMVisitor visitor) {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
parent = visitor;
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ public class PMDASMVisitor extends ClassVisitor {
|
||||
private PMDASMVisitor parent;
|
||||
|
||||
public PMDSignatureVisitor(PMDASMVisitor visitor) {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
this.parent = visitor;
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ public class PMDASMVisitor extends ClassVisitor {
|
||||
private PMDASMVisitor parent;
|
||||
|
||||
public PMDMethodVisitor(PMDASMVisitor visitor) {
|
||||
super(Opcodes.ASM4);
|
||||
super(Opcodes.ASM5);
|
||||
parent = visitor;
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@ public class PMDASMVisitor extends ClassVisitor {
|
||||
parent.addType(Type.getType(desc));
|
||||
}
|
||||
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
|
||||
parent.parseClassName(owner);
|
||||
parent.addMethodDesc(desc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user