public String getGenericKey() { if (signature != null) { return name + signature; } return getKey(); }
public String getGenericKey() { if (signature != null) { return name + signature; } return getKey(); }
void addMethod(AsmMethod asmMethod) { methods.put(asmMethod.getKey(), asmMethod); }
void addMethod(AsmMethod asmMethod) { methods.put(asmMethod.getKey(), asmMethod); }
@Override public void visitEdge(AsmEdge edge) { if (edge.getTo() instanceof AsmMethod) { AsmMethod targetMethod = (AsmMethod) edge.getTo(); AsmClass targetClass = targetMethod.getParent(); if ("java/io/File".equals(targetClass.getInternalName()) && "deleteOnExit()V".equals(targetMethod.getKey())) { SourceFile sourceFile = getSourceFile(asmClass); CheckMessage message = new CheckMessage(this, "Do not use method 'File#deleteOnExit()'."); message.setLine(edge.getSourceLineNumber()); sourceFile.log(message); } } }
public void process(AsmMethod method) { if (!method.isBodyLoaded() && method.isUsed()) { AsmMethod implementation = findImplementation(method.getParent(), method.getKey()); if (implementation != null) { implementation.setUsed(true); method.linkTo(implementation); } } }
public void process(AsmMethod method) { if (!method.isBodyLoaded() && method.isUsed()) { AsmMethod implementation = findImplementation(method.getParent(), method.getKey()); if (implementation != null) { implementation.setUsed(true); method.linkTo(implementation); } } }
@Override public MethodVisitor visitMethod(int access, String methodName, String description, String signature, String[] exceptions) { AsmMethod method = asmClass.getMethodOrCreateIt(methodName + description); if (isInheritedMethodSignature(method.getParent(), method.getKey())) { method.setInherited(true); } method.setSignature(signature); method.setBodyLoaded(true); method.setAccessFlags(access); method.clearOutogingEdges(); String[] internalNames = AsmSignature.extractInternalNames(description, signature); AsmClass[] asmClasses = internalNamesToAsmClasses(internalNames, DETAIL_LEVEL.NOTHING); method.addUsesOfClasses(asmClasses); AsmClass[] asmExceptionClasses = internalNamesToAsmClasses(exceptions, DETAIL_LEVEL.STRUCTURE); method.addUsesOfClasses(asmExceptionClasses); method.addThrowsOfClasses(asmExceptionClasses); if (level == DETAIL_LEVEL.STRUCTURE_AND_CALLS) { return new AsmMethodVisitor(method, asmClassProvider); } return null; }
@Override public MethodVisitor visitMethod(int access, String methodName, String description, String signature, String[] exceptions) { AsmMethod method = asmClass.getMethodOrCreateIt(methodName + description); if (isInheritedMethodSignature(method.getParent(), method.getKey())) { method.setInherited(true); } method.setSignature(signature); method.setBodyLoaded(true); method.setAccessFlags(access); method.clearOutogingEdges(); String[] internalNames = AsmSignature.extractInternalNames(description, signature); AsmClass[] asmClasses = internalNamesToAsmClasses(internalNames, DETAIL_LEVEL.NOTHING); method.addUsesOfClasses(asmClasses); AsmClass[] asmExceptionClasses = internalNamesToAsmClasses(exceptions, DETAIL_LEVEL.STRUCTURE); method.addUsesOfClasses(asmExceptionClasses); method.addThrowsOfClasses(asmExceptionClasses); if (level == DETAIL_LEVEL.STRUCTURE_AND_CALLS) { return new AsmMethodVisitor(method, asmClassProvider); } return null; }