Class OpcodeStack.Item

java.lang.Object
edu.umd.cs.findbugs.OpcodeStack.Item
Enclosing class:
OpcodeStack

public static class OpcodeStack.Item extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • 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()
      Overrides:
      hashCode in class Object
    • usesTwoSlots

      public boolean usesTwoSlots()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • sameValue

      public boolean sameValue(OpcodeStack.Item that)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • merge

      public static OpcodeStack.Item merge(OpcodeStack.Item i1, OpcodeStack.Item i2)
    • initialArgument

      public static OpcodeStack.Item initialArgument(String signature, int reg)
    • typeOnly

      public static OpcodeStack.Item typeOnly(String signature)
    • 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

      public void setLoadedFromField(XField f, int fieldLoadedFromRegister)
    • getHttpParameterName

      @CheckForNull public String getHttpParameterName()
    • getInjectionPC

      public int getInjectionPC()
    • setCouldBeNegative

      public void setCouldBeNegative()
    • nullItem

      public static OpcodeStack.Item nullItem(String signature)
    • getJavaClass

      @CheckForNull public org.apache.bcel.classfile.JavaClass getJavaClass() throws ClassNotFoundException
      Returns null for primitive and arrays
      Throws:
      ClassNotFoundException
    • isArray

      public boolean isArray()
    • getElementSignature

      @Deprecated public String getElementSignature()
      Deprecated.
    • isNonNegative

      public boolean isNonNegative()
    • isPrimitive

      public boolean isPrimitive()
    • getRegisterNumber

      public int getRegisterNumber()
    • getSignature

      public String getSignature()
    • getConstant

      public Object 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 public FieldAnnotation getFieldAnnotation()
      Deprecated.
      Use getXField instead
    • getXField

      public XField getXField()
    • setSpecialKind

      public void setSpecialKind(@SpecialKind int specialKind)
      Parameters:
      specialKind - The specialKind to set.
    • cloneAndSetSpecialKind

      public OpcodeStack.Item cloneAndSetSpecialKind(@SpecialKind int specialKind)
    • getSpecialKind

      @SpecialKind public int getSpecialKind()
      Returns:
      Returns the specialKind.
    • isBooleanNullnessValue

      public boolean isBooleanNullnessValue()
      Returns:
      Returns the specialKind.
    • setUserValue

      public void setUserValue(@Nullable Object value)

      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

      @CheckForNull public XMethod 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

      @Nullable public Object 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

      @SpecialKind public int getSpecialKindForAbs()
    • getSpecialKindForRemainder

      @SpecialKind public int 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
    • isInitialParameter

      public boolean isInitialParameter()
      Returns:
      Returns the isInitialParameter.
    • 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

      @SpecialKind public static int defineSpecialKind(String name)
      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

      public static Optional<String> getSpecialKindName(@SpecialKind int specialKind)
      Parameters:
      specialKind - special kind to get name
      Returns:
      just a name of specified @{link SpecialKind}, or empty Optional.
      Since:
      3.1.0