@Override public boolean isSignificant() { String role = getDescription(); if (METHOD_DANGEROUS_TARGET.equals(role) || METHOD_DANGEROUS_TARGET_ACTUAL_GUARANTEED_NULL.equals(role) || METHOD_SAFE_TARGET.equals(role) || METHOD_EQUALS_USED.equals(role) || METHOD_COMPUTED_IN.equals(role)) { return false; } return true; } }
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; }
if (primeMethod != null && (showContext || !MethodAnnotation.DEFAULT_ROLE.equals(primeMethod.getDescription()))) { result.add(primeMethod);
@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); } }
@Override public boolean isSignificant() { String role = getDescription(); if (METHOD_DANGEROUS_TARGET.equals(role) || METHOD_DANGEROUS_TARGET_ACTUAL_GUARANTEED_NULL.equals(role) || METHOD_SAFE_TARGET.equals(role) || METHOD_EQUALS_USED.equals(role) || METHOD_COMPUTED_IN.equals(role)) { return false; } return true; } }
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; }
if (primeMethod != null && (showContext || !MethodAnnotation.DEFAULT_ROLE.equals(primeMethod.getDescription()))) { result.add(primeMethod);
@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); } }