Class JDT2CAstUtils


  • public class JDT2CAstUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JDT2CAstUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.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 java.util.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.
      static com.ibm.wala.cast.tree.impl.CAstOperator 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 com.ibm.wala.cast.tree.impl.CAstOperator mapBinaryOpcode​(org.eclipse.jdt.core.dom.InfixExpression.Operator operator)  
      static java.util.Collection<com.ibm.wala.cast.tree.CAstQualifier> 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 Detail

      • JDT2CAstUtils

        public JDT2CAstUtils()
    • Method Detail

      • mapModifiersToQualifiers

        public static java.util.Collection<com.ibm.wala.cast.tree.CAstQualifier> mapModifiersToQualifiers​(int modifiers,
                                                                                                          boolean isInterface,
                                                                                                          boolean isAnnotation)
      • mapAssignOperator

        public static com.ibm.wala.cast.tree.impl.CAstOperator mapAssignOperator​(org.eclipse.jdt.core.dom.Assignment.Operator op)
      • mapBinaryOpcode

        protected static com.ibm.wala.cast.tree.impl.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 java.lang.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 java.util.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)