|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.ClassHash
public class ClassHash
Compute a hash of method names and signatures. This allows us to find out when a class has been renamed, but not changed in any other obvious way.
Field Summary | |
---|---|
static java.lang.String |
CLASS_HASH_ELEMENT_NAME
XML element name for a ClassHash. |
static java.lang.String |
METHOD_HASH_ELEMENT_NAME
XML element name for a MethodHash. |
Constructor Summary | |
---|---|
ClassHash()
Constructor. |
|
ClassHash(java.lang.String className,
byte[] classHash)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(ClassHash other)
|
ClassHash |
computeHash(org.apache.bcel.classfile.JavaClass javaClass)
Compute hash for given class and all of its methods. |
boolean |
equals(java.lang.Object o)
|
byte[] |
getClassHash()
Get class hash. |
java.lang.String |
getClassName()
|
MethodHash |
getMethodHash(XMethod method)
Get method hash for given method. |
int |
hashCode()
|
static java.lang.String |
hashToString(byte[] hash)
Convert a hash to a string of hex digits. |
boolean |
isSameHash(ClassHash other)
Return whether or not this class hash has the same hash value as the one given. |
void |
setClassHash(byte[] classHash)
Set class hash. |
void |
setMethodHash(XMethod method,
byte[] methodHash)
Set method hash for given method. |
static byte[] |
stringToHash(java.lang.String s)
Convert a string of hex digits to a hash. |
java.lang.String |
toString()
|
void |
writeXML(XMLOutput xmlOutput)
Write this object to given XMLOutput. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_HASH_ELEMENT_NAME
public static final java.lang.String METHOD_HASH_ELEMENT_NAME
Constructor Detail |
---|
public ClassHash()
public ClassHash(java.lang.String className, byte[] classHash)
classHash
- pre-computed class hashMethod Detail |
---|
public void setMethodHash(XMethod method, byte[] methodHash)
method
- the methodmethodHash
- the method hashpublic java.lang.String getClassName()
public byte[] getClassHash()
public void setClassHash(byte[] classHash)
classHash
- the class hash value to setpublic MethodHash getMethodHash(XMethod method)
method
- the method
public ClassHash computeHash(org.apache.bcel.classfile.JavaClass javaClass)
javaClass
- the class
public void writeXML(XMLOutput xmlOutput) throws java.io.IOException
XMLWriteable
writeXML
in interface XMLWriteable
xmlOutput
- the XMLOutput for the document
java.io.IOException
public static java.lang.String hashToString(byte[] hash)
hash
- the hash
public static byte[] stringToHash(java.lang.String s)
s
- string of hex digits
public boolean isSameHash(ClassHash other)
other
- another ClassHash
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(ClassHash other)
compareTo
in interface java.lang.Comparable<ClassHash>
public java.lang.String toString()
toString
in class java.lang.Object
|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |