Package edu.umd.cs.findbugs
Class OpcodeStack.Item
java.lang.Object
edu.umd.cs.findbugs.OpcodeStack.Item
- Enclosing class:
OpcodeStack
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
A type qualifier to markint
value as SpecialKind type. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private Object
private static final int
private int
static final int
static final int
private int
static final int
static final int
static final int
static final int
private static final int
private static final int
static final int
static final int
static final int
static final int
static final int
static final int
private static AtomicInteger
static final int
static final int
static final int
private int
static final int
static final int
private int
static final int
static final int
static final int
static final int
private String
static final int
private ClassMember
private int
private static final ConcurrentMap
<Integer, String> static final int
static final Object
private Object
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionItem()
Item
(OpcodeStack.Item it) Item
(OpcodeStack.Item it, int reg) Item
(OpcodeStack.Item it, String signature) Item
(String signature, FieldAnnotation f) Item
(String signature, FieldAnnotation f, int fieldLoadedFromRegister) -
Method Summary
Modifier and TypeMethodDescription(package private) static int
asSpecialKind
(int kind) boolean
Value could be Integer.MIN_VALUEvoid
cloneAndSetSpecialKind
(int specialKind) boolean
static int
defineSpecialKind
(String name) Define a new special kind and name it as specified.boolean
Returns a constant value for this Item, if known.Deprecated.Deprecated.int
If this value was loaded from an instance field, give the register number containing the object that the field was loaded from.int
org.apache.bcel.classfile.JavaClass
Returns null for primitive and arraysint
getPC()
int
int
getSize()
int
int
int
getSpecialKindName
(int specialKind) gets the detector specified value for this itemboolean
hasConstantValue
(int value) boolean
hasConstantValue
(long value) int
hashCode()
static OpcodeStack.Item
initialArgument
(String signature, int reg) boolean
isArray()
boolean
private boolean
boolean
boolean
boolean
boolean
isNull()
boolean
boolean
boolean
boolean
isWide()
private boolean
isZero()
void
static OpcodeStack.Item
merge
(OpcodeStack.Item i1, OpcodeStack.Item i2) boolean
The result of applying Math.abs to a checkForIntegerMinValue() valueboolean
static OpcodeStack.Item
boolean
sameValue
(OpcodeStack.Item that) void
private void
setCouldBeZero
(boolean couldBeZero) private void
setFlag
(boolean value, int flagBit) private void
setInitialParameter
(boolean isInitialParameter) void
void
setLoadedFromField
(XField f, int fieldLoadedFromRegister) private void
setNull
(boolean isNull) void
setPC
(int pc) void
void
setSpecialKind
(int specialKind) private void
void
setUserValue
(Object value) attaches a detector specified value to this itemtoString()
static OpcodeStack.Item
boolean
boolean
-
Field Details
-
NOT_SPECIAL
- See Also:
-
SIGNED_BYTE
- See Also:
-
RANDOM_INT
- See Also:
-
LOW_8_BITS_CLEAR
- See Also:
-
HASHCODE_INT
- See Also:
-
INTEGER_SUM
- See Also:
-
AVERAGE_COMPUTED_USING_DIVISION
- See Also:
-
FLOAT_MATH
- See Also:
-
RANDOM_INT_REMAINDER
- See Also:
-
HASHCODE_INT_REMAINDER
- See Also:
-
FILE_SEPARATOR_STRING
- See Also:
-
MATH_ABS
- See Also:
-
MATH_ABS_OF_RANDOM
- See Also:
-
MATH_ABS_OF_HASHCODE
- See Also:
-
NON_NEGATIVE
- See Also:
-
NASTY_FLOAT_MATH
- See Also:
-
FILE_OPENED_IN_APPEND_MODE
- See Also:
-
SERVLET_REQUEST_TAINTED
- See Also:
-
NEWLY_ALLOCATED
- See Also:
-
ZERO_MEANS_NULL
- See Also:
-
NONZERO_MEANS_NULL
- See Also:
-
RESULT_OF_I2L
- See Also:
-
RESULT_OF_L2I
- See Also:
-
SERVLET_OUTPUT
- See Also:
-
TYPE_ONLY
- See Also:
-
specialKindToName
-
nextSpecialKind
-
IS_INITIAL_PARAMETER_FLAG
private static final int IS_INITIAL_PARAMETER_FLAG- See Also:
-
COULD_BE_ZERO_FLAG
private static final int COULD_BE_ZERO_FLAG- See Also:
-
IS_NULL_FLAG
private static final int IS_NULL_FLAG- See Also:
-
UNKNOWN
-
specialKind
-
signature
-
constValue
-
source
-
pc
private int pc -
flags
private int flags -
registerNumber
private int registerNumber -
userValue
-
injection
-
fieldLoadedFromRegister
private int fieldLoadedFromRegister
-
-
Constructor Details
-
Item
-
Item
-
Item
-
Item
-
Item
-
Item
-
Item
-
Item
-
Item
public Item()
-
-
Method Details
-
asSpecialKind
-
makeCrossMethod
public void makeCrossMethod() -
getSize
public int getSize() -
getPC
public int getPC() -
setPC
public void setPC(int pc) -
isWide
public boolean isWide() -
hashCode
public int hashCode() -
usesTwoSlots
public boolean usesTwoSlots() -
equals
-
sameValue
-
toString
-
merge
-
initialArgument
-
typeOnly
-
getFieldLoadedFromRegister
public int getFieldLoadedFromRegister()If this value was loaded from an instance field, give the register number containing the object that the field was loaded from. If Integer.MAX value, the value was loaded from a static field If -1, we don't know or don't have the register containing the object that the field was loaded from. -
setLoadedFromField
-
getHttpParameterName
-
getInjectionPC
public int getInjectionPC() -
setSpecialKindFromSignature
private void setSpecialKindFromSignature() -
setCouldBeNegative
public void setCouldBeNegative() -
nullItem
-
getJavaClass
@CheckForNull public org.apache.bcel.classfile.JavaClass getJavaClass() throws ClassNotFoundExceptionReturns null for primitive and arrays- Throws:
ClassNotFoundException
-
isArray
public boolean isArray() -
getElementSignature
Deprecated. -
isNonNegative
public boolean isNonNegative() -
isPrimitive
public boolean isPrimitive() -
getRegisterNumber
public int getRegisterNumber() -
getSignature
-
getConstant
Returns a constant value for this Item, if known. NOTE: if the value is a constant Class object, the constant value returned is the name of the class. if the value is an array of known length, the constant value returned is its length (Integer) -
getFieldAnnotation
Deprecated.Use getXField instead -
getXField
-
setSpecialKind
- Parameters:
specialKind
- The specialKind to set.
-
cloneAndSetSpecialKind
-
getSpecialKind
- Returns:
- Returns the specialKind.
-
isBooleanNullnessValue
public boolean isBooleanNullnessValue()- Returns:
- Returns the specialKind.
-
setUserValue
attaches a detector specified value to this item
to use this method, detector should be annotated with
CustomUserValue
.- Parameters:
value
- the custom value to set- See Also:
-
getReturnValueOf
- Returns:
- if this value is the return value of a method, give the method invoked
-
couldBeZero
public boolean couldBeZero() -
mustBeZero
public boolean mustBeZero() -
getUserValue
gets the detector specified value for this item- Returns:
- the custom value
-
isServletParameterTainted
public boolean isServletParameterTainted() -
setServletParameterTainted
public void setServletParameterTainted() -
setIsServletWriter
public void setIsServletWriter() -
isServletWriter
public boolean isServletWriter() -
valueCouldBeNegative
public boolean valueCouldBeNegative() -
getSpecialKindForAbs
-
getSpecialKindForRemainder
-
checkForIntegerMinValue
public boolean checkForIntegerMinValue()Value could be Integer.MIN_VALUE -
mightRarelyBeNegative
public boolean mightRarelyBeNegative()The result of applying Math.abs to a checkForIntegerMinValue() value -
setInitialParameter
private void setInitialParameter(boolean isInitialParameter) - Parameters:
isInitialParameter
- The isInitialParameter to set.
-
isInitialParameter
public boolean isInitialParameter()- Returns:
- Returns the isInitialParameter.
-
setCouldBeZero
private void setCouldBeZero(boolean couldBeZero) - Parameters:
couldBeZero
- The couldBeZero to set.
-
isCouldBeZero
private boolean isCouldBeZero()- Returns:
- Returns the couldBeZero.
-
isZero
private boolean isZero() -
setNull
private void setNull(boolean isNull) - Parameters:
isNull
- The isNull to set.
-
setFlag
private void setFlag(boolean value, int flagBit) -
isNull
public boolean isNull()- Returns:
- Returns the isNull.
-
clearNewlyAllocated
public void clearNewlyAllocated() -
isNewlyAllocated
public boolean isNewlyAllocated() -
hasConstantValue
public boolean hasConstantValue(int value) -
hasConstantValue
public boolean hasConstantValue(long value) -
defineSpecialKind
Define a new special kind and name it as specified.- Parameters:
name
- Name of new special kind- Returns:
- int value to represent new special kind
- Since:
- 3.1.0
-
getSpecialKindName
- Parameters:
specialKind
- special kind to get name- Returns:
- just a name of specified @{link SpecialKind}, or empty
Optional
. - Since:
- 3.1.0
-