Class JDT2CAstUtils

java.lang.Object
com.ibm.wala.cast.java.translator.jdt.JDT2CAstUtils

public class JDT2CAstUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Object
    defaultValueForType(org.eclipse.jdt.core.dom.ITypeBinding type)
    If isLongOrLess(type), returns Integer(0).
    static org.eclipse.jdt.core.dom.ITypeBinding
    getDeclaringClassOfNode(org.eclipse.jdt.core.dom.ASTNode n)
     
    static org.eclipse.jdt.core.dom.ITypeBinding
    getErasedType(org.eclipse.jdt.core.dom.ITypeBinding returnType, org.eclipse.jdt.core.dom.AST ast)
    If a type variable, return the bound (getTypeVariablesBase()).
    static Collection<org.eclipse.jdt.core.dom.IMethodBinding>
    getOverriddenMethod(org.eclipse.jdt.core.dom.IMethodBinding met)
     
    static org.eclipse.jdt.core.dom.ITypeBinding
    getTypesVariablesBase(org.eclipse.jdt.core.dom.ITypeBinding returnType, org.eclipse.jdt.core.dom.AST ast)
     
    static boolean
    isLongOrLess(org.eclipse.jdt.core.dom.ITypeBinding type)
    Returns true if type is char, byte, short, int, or long.
    mapAssignOperator(org.eclipse.jdt.core.dom.Assignment.Operator op)
     
    static org.eclipse.jdt.core.dom.InfixExpression.Operator
    mapAssignOperatorToInfixOperator(org.eclipse.jdt.core.dom.Assignment.Operator op)
     
    protected static CAstOperator
    mapBinaryOpcode(org.eclipse.jdt.core.dom.InfixExpression.Operator operator)
     
    mapModifiersToQualifiers(int modifiers, boolean isInterface, boolean isAnnotation)
     
    static org.eclipse.jdt.core.dom.ITypeBinding
    promoteTypes(org.eclipse.jdt.core.dom.ITypeBinding t1, org.eclipse.jdt.core.dom.ITypeBinding t2, org.eclipse.jdt.core.dom.AST ast)
     
    static boolean
    sameErasedSignatureAndReturnType(org.eclipse.jdt.core.dom.IMethodBinding met1, org.eclipse.jdt.core.dom.IMethodBinding met2)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JDT2CAstUtils

      public JDT2CAstUtils()
  • Method Details

    • mapModifiersToQualifiers

      public static Collection<CAstQualifier> mapModifiersToQualifiers(int modifiers, boolean isInterface, boolean isAnnotation)
    • mapAssignOperator

      public static CAstOperator mapAssignOperator(org.eclipse.jdt.core.dom.Assignment.Operator op)
    • mapBinaryOpcode

      protected static CAstOperator mapBinaryOpcode(org.eclipse.jdt.core.dom.InfixExpression.Operator operator)
    • isLongOrLess

      public static boolean isLongOrLess(org.eclipse.jdt.core.dom.ITypeBinding type)
      Returns true if type is char, byte, short, int, or long. Return false otherwise (including boolean!)
    • defaultValueForType

      public static Object defaultValueForType(org.eclipse.jdt.core.dom.ITypeBinding type)
      If isLongOrLess(type), returns Integer(0). If a float or double, returns Double(0.0) Otherwise (including boolean), returns CAstSymbol.NULL_DEFAULT_VALUE.
    • promoteTypes

      public static org.eclipse.jdt.core.dom.ITypeBinding promoteTypes(org.eclipse.jdt.core.dom.ITypeBinding t1, org.eclipse.jdt.core.dom.ITypeBinding t2, org.eclipse.jdt.core.dom.AST ast)
    • getDeclaringClassOfNode

      public static org.eclipse.jdt.core.dom.ITypeBinding getDeclaringClassOfNode(org.eclipse.jdt.core.dom.ASTNode n)
    • getErasedType

      public static org.eclipse.jdt.core.dom.ITypeBinding getErasedType(org.eclipse.jdt.core.dom.ITypeBinding returnType, org.eclipse.jdt.core.dom.AST ast)
      If a type variable, return the bound (getTypeVariablesBase()). If a parameterized type, return the generic type.
    • getTypesVariablesBase

      public static org.eclipse.jdt.core.dom.ITypeBinding getTypesVariablesBase(org.eclipse.jdt.core.dom.ITypeBinding returnType, org.eclipse.jdt.core.dom.AST ast)
    • mapAssignOperatorToInfixOperator

      public static org.eclipse.jdt.core.dom.InfixExpression.Operator mapAssignOperatorToInfixOperator(org.eclipse.jdt.core.dom.Assignment.Operator op)
    • getOverriddenMethod

      public static Collection<org.eclipse.jdt.core.dom.IMethodBinding> getOverriddenMethod(org.eclipse.jdt.core.dom.IMethodBinding met)
    • sameErasedSignatureAndReturnType

      public static boolean sameErasedSignatureAndReturnType(org.eclipse.jdt.core.dom.IMethodBinding met1, org.eclipse.jdt.core.dom.IMethodBinding met2)