public class LocalVariableAnnotation extends java.lang.Object implements BugAnnotation
BugAnnotation
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
ARGUMENT_ROLE |
static java.lang.String |
DEFAULT_ROLE |
static java.lang.String |
DID_YOU_MEAN_ROLE |
static java.lang.String |
INVOKED_ON_ROLE |
static java.lang.String |
NAMED_ROLE |
static java.lang.String |
PARAMETER_NAMED_ROLE |
static java.lang.String |
PARAMETER_ROLE |
static java.lang.String |
PARAMETER_VALUE_SOURCE_NAMED_ROLE |
static java.lang.String |
PARAMETER_VALUE_SOURCE_ROLE |
static java.lang.String |
UNKNOWN_ROLE |
static java.lang.String |
VALUE_DOOMED_NAMED_ROLE |
static java.lang.String |
VALUE_DOOMED_ROLE |
static java.lang.String |
VALUE_OF_ROLE |
MESSAGE_TAG
Constructor and Description |
---|
LocalVariableAnnotation(java.lang.String name,
int register,
int pc)
Constructor.
|
LocalVariableAnnotation(java.lang.String name,
int register,
int pc,
int line)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(BugAnnotationVisitor visitor)
Accept a BugAnnotationVisitor.
|
java.lang.Object |
clone() |
int |
compareTo(BugAnnotation o) |
boolean |
equals(java.lang.Object o) |
static LocalVariableAnnotation |
findMatchingIgnoredParameter(ClassContext classContext,
org.apache.bcel.classfile.Method method,
java.lang.String name,
java.lang.String signature) |
static LocalVariableAnnotation |
findUniqueBestMatchingParameter(ClassContext classContext,
org.apache.bcel.classfile.Method method,
java.lang.String name,
java.lang.String signature) |
java.lang.String |
format(java.lang.String key,
ClassAnnotation primaryClass)
Format the annotation as a String.
|
java.lang.String |
getDescription()
Get a description of this bug annotation.
|
static LocalVariableAnnotation |
getLocalVariableAnnotation(DismantleBytecode visitor,
OpcodeStack.Item item) |
static LocalVariableAnnotation |
getLocalVariableAnnotation(org.apache.bcel.classfile.Method method,
int local,
int position1,
int position2) |
static LocalVariableAnnotation |
getLocalVariableAnnotation(org.apache.bcel.classfile.Method method,
Location location,
org.apache.bcel.generic.IndexedInstruction ins) |
static LocalVariableAnnotation |
getLocalVariableAnnotation(org.apache.bcel.classfile.Method method,
OpcodeStack.Item item,
int pc) |
java.lang.String |
getName() |
static LocalVariableAnnotation |
getParameterLocalVariableAnnotation(org.apache.bcel.classfile.Method method,
int local)
Get a local variable annotation describing a parameter.
|
int |
getPC() |
int |
getRegister() |
int |
hashCode() |
boolean |
isNamed() |
boolean |
isSignificant()
Is this annotation used to compute instance hashes or match bug instances
across versions
|
void |
setDescription(java.lang.String description)
Set a description of this bug annotation.
|
java.lang.String |
toString() |
java.lang.String |
toString(ClassAnnotation primaryClass) |
void |
writeXML(XMLOutput xmlOutput)
Write this object to given XMLOutput.
|
void |
writeXML(XMLOutput xmlOutput,
boolean addMessages,
boolean isPrimary) |
public static final java.lang.String DEFAULT_ROLE
public static final java.lang.String NAMED_ROLE
public static final java.lang.String UNKNOWN_ROLE
public static final java.lang.String PARAMETER_ROLE
public static final java.lang.String PARAMETER_NAMED_ROLE
public static final java.lang.String PARAMETER_VALUE_SOURCE_ROLE
public static final java.lang.String PARAMETER_VALUE_SOURCE_NAMED_ROLE
public static final java.lang.String VALUE_DOOMED_ROLE
public static final java.lang.String VALUE_DOOMED_NAMED_ROLE
public static final java.lang.String DID_YOU_MEAN_ROLE
public static final java.lang.String INVOKED_ON_ROLE
public static final java.lang.String ARGUMENT_ROLE
public static final java.lang.String VALUE_OF_ROLE
public LocalVariableAnnotation(java.lang.String name, int register, int pc)
name
- the name of the local variableregister
- the local variable indexpc
- the bytecode offset of the instruction that mentions this
local variablepublic LocalVariableAnnotation(java.lang.String name, int register, int pc, int line)
name
- the name of the local variableregister
- the local variable indexpc
- the bytecode offset of the instruction that mentions this
local variablepublic static LocalVariableAnnotation getLocalVariableAnnotation(org.apache.bcel.classfile.Method method, Location location, org.apache.bcel.generic.IndexedInstruction ins)
public static LocalVariableAnnotation getLocalVariableAnnotation(org.apache.bcel.classfile.Method method, int local, int position1, int position2)
public static LocalVariableAnnotation getParameterLocalVariableAnnotation(org.apache.bcel.classfile.Method method, int local)
method
- a Methodlocal
- the local variable containing the parameterpublic java.lang.Object clone()
clone
in interface BugAnnotation
clone
in class java.lang.Object
public void accept(BugAnnotationVisitor visitor)
BugAnnotation
accept
in interface BugAnnotation
visitor
- the visitor to acceptpublic java.lang.String format(java.lang.String key, ClassAnnotation primaryClass)
BugAnnotation
format
in interface BugAnnotation
key
- how the annotation should be formattedprimaryClass
- The primary class for the bug; some bug annotation format msgs
are simplified in relation to that class.public void setDescription(java.lang.String description)
BugAnnotation
setDescription
in interface BugAnnotation
public java.lang.String getDescription()
BugAnnotation
getDescription
in interface BugAnnotation
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(BugAnnotation o)
compareTo
in interface java.lang.Comparable<BugAnnotation>
public java.lang.String toString()
toString
in class java.lang.Object
public void writeXML(XMLOutput xmlOutput) throws java.io.IOException
XMLWriteable
writeXML
in interface XMLWriteable
xmlOutput
- the XMLOutput for the documentjava.io.IOException
public void writeXML(XMLOutput xmlOutput, boolean addMessages, boolean isPrimary) throws java.io.IOException
writeXML
in interface XMLWriteableWithMessages
java.io.IOException
public boolean isNamed()
public java.lang.String getName()
public int getPC()
public int getRegister()
public boolean isSignificant()
BugAnnotation
isSignificant
in interface BugAnnotation
@CheckForNull public static LocalVariableAnnotation getLocalVariableAnnotation(org.apache.bcel.classfile.Method method, OpcodeStack.Item item, int pc)
@CheckForNull public static LocalVariableAnnotation getLocalVariableAnnotation(DismantleBytecode visitor, OpcodeStack.Item item)
@CheckForNull public static LocalVariableAnnotation findMatchingIgnoredParameter(ClassContext classContext, org.apache.bcel.classfile.Method method, java.lang.String name, java.lang.String signature)
@CheckForNull public static LocalVariableAnnotation findUniqueBestMatchingParameter(ClassContext classContext, org.apache.bcel.classfile.Method method, java.lang.String name, java.lang.String signature)
public java.lang.String toString(ClassAnnotation primaryClass)
toString
in interface BugAnnotation
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.