static MethodAnnotation obfuscate(MethodAnnotation m) { String className = m.getClassName(); if (className.startsWith("java")) { return m; } String methodName = m.getMethodName(); String methodSignature = m.getMethodSignature(); if ("hashCode".equals(methodName) && "()I".equals(methodSignature) || "equals".equals(methodName) && "(Ljava/lang/Object;)Z".equals(methodSignature) || "compareTo".equals(methodName) && "(Ljava/lang/Object;)I".equals(methodSignature) || "<init>".equals(methodName) || "<clinit>".equals(methodName)) { // don't need to obfuscate method name } else { methodName = hashData(methodName); } MethodAnnotation result = new MethodAnnotation(hashClass(className), methodName, hashMethodSignature(methodSignature), m.isStatic()); result.setDescription(m.getDescription()); return result; }
public static XMethod createXMethod(MethodAnnotation ma) { return createXMethod(ma.getClassName(), ma.getMethodName(), ma.getMethodSignature(), ma.isStatic()); }
public MethodDescriptor getMethodDescriptor(MethodAnnotation ma) { return getMethodDescriptor(ClassName.toSlashedClassName(ma.getClassName()), ma.getMethodName(), ma.getMethodSignature(), ma.isStatic()); }
/** * Rewrite a MethodAnnotation to update the class name, and any class names * mentioned in the method signature. * * @param classNameRewriter * a ClassNameRewriter * @param annotation * a MethodAnnotation * @return the possibly-rewritten MethodAnnotation */ public static MethodAnnotation convertMethodAnnotation(ClassNameRewriter classNameRewriter, MethodAnnotation annotation) { if (classNameRewriter != IdentityClassNameRewriter.instance()) { annotation = new MethodAnnotation(classNameRewriter.rewriteClassName(annotation.getClassName()), annotation.getMethodName(), rewriteMethodSignature(classNameRewriter, annotation.getMethodSignature()), annotation.isStatic()); } return annotation; }
@Override public void writeXML(XMLOutput xmlOutput, boolean addMessages, boolean isPrimary) throws IOException { XMLAttributeList attributeList = new XMLAttributeList().addAttribute("classname", getClassName()) .addAttribute("name", getMethodName()).addAttribute("signature", getMethodSignature()) .addAttribute("isStatic", String.valueOf(isStatic())); if (isPrimary) { attributeList.addAttribute("primary", "true"); } String role = getDescription(); if (!DEFAULT_ROLE.equals(role)) { attributeList.addAttribute("role", role); } if (sourceLines == null && !addMessages) { xmlOutput.openCloseTag(ELEMENT_NAME, attributeList); } else { xmlOutput.openTag(ELEMENT_NAME, attributeList); if (sourceLines != null) { sourceLines.writeXML(xmlOutput); } if (addMessages) { xmlOutput.openTag(MESSAGE_TAG); xmlOutput.writeText(this.toString()); xmlOutput.closeTag(MESSAGE_TAG); } xmlOutput.closeTag(ELEMENT_NAME); } }
if (calledMethodAnnotation != null && calledMethodAnnotation.isStatic()){ type = "DMI_DOH"; priority = LOW_PRIORITY;
static MethodAnnotation obfuscate(MethodAnnotation m) { String className = m.getClassName(); if (className.startsWith("java")) { return m; } String methodName = m.getMethodName(); String methodSignature = m.getMethodSignature(); if ("hashCode".equals(methodName) && "()I".equals(methodSignature) || "equals".equals(methodName) && "(Ljava/lang/Object;)Z".equals(methodSignature) || "compareTo".equals(methodName) && "(Ljava/lang/Object;)I".equals(methodSignature) || "<init>".equals(methodName) || "<clinit>".equals(methodName)) { // don't need to obfuscate method name } else { methodName = hashData(methodName); } MethodAnnotation result = new MethodAnnotation(hashClass(className), methodName, hashMethodSignature(methodSignature), m.isStatic()); result.setDescription(m.getDescription()); return result; }
public static XMethod createXMethod(MethodAnnotation ma) { return createXMethod(ma.getClassName(), ma.getMethodName(), ma.getMethodSignature(), ma.isStatic()); }
public MethodDescriptor getMethodDescriptor(MethodAnnotation ma) { return getMethodDescriptor(ClassName.toSlashedClassName(ma.getClassName()), ma.getMethodName(), ma.getMethodSignature(), ma.isStatic()); }
/** * Rewrite a MethodAnnotation to update the class name, and any class names * mentioned in the method signature. * * @param classNameRewriter * a ClassNameRewriter * @param annotation * a MethodAnnotation * @return the possibly-rewritten MethodAnnotation */ public static MethodAnnotation convertMethodAnnotation(ClassNameRewriter classNameRewriter, MethodAnnotation annotation) { if (classNameRewriter != IdentityClassNameRewriter.instance()) { annotation = new MethodAnnotation(classNameRewriter.rewriteClassName(annotation.getClassName()), annotation.getMethodName(), rewriteMethodSignature(classNameRewriter, annotation.getMethodSignature()), annotation.isStatic()); } return annotation; }
@Override public void writeXML(XMLOutput xmlOutput, boolean addMessages, boolean isPrimary) throws IOException { XMLAttributeList attributeList = new XMLAttributeList().addAttribute("classname", getClassName()) .addAttribute("name", getMethodName()).addAttribute("signature", getMethodSignature()) .addAttribute("isStatic", String.valueOf(isStatic())); if (isPrimary) { attributeList.addAttribute("primary", "true"); } String role = getDescription(); if (!DEFAULT_ROLE.equals(role)) { attributeList.addAttribute("role", role); } if (sourceLines == null && !addMessages) { xmlOutput.openCloseTag(ELEMENT_NAME, attributeList); } else { xmlOutput.openTag(ELEMENT_NAME, attributeList); if (sourceLines != null) { sourceLines.writeXML(xmlOutput); } if (addMessages) { xmlOutput.openTag(MESSAGE_TAG); xmlOutput.writeText(this.toString()); xmlOutput.closeTag(MESSAGE_TAG); } xmlOutput.closeTag(ELEMENT_NAME); } }
if (calledMethodAnnotation != null && calledMethodAnnotation.isStatic()){ type = "DMI_DOH"; priority = LOW_PRIORITY;