コード例 #1
0
 private static boolean isNanTest(BinaryExpressionTree tree) {
   Type leftOperandType = tree.leftOperand().symbolType();
   if (tree.is(Tree.Kind.NOT_EQUAL_TO)
       && (leftOperandType.isPrimitive(Type.Primitives.FLOAT)
           || leftOperandType.isPrimitive(Type.Primitives.DOUBLE))) {
     return true;
   }
   return false;
 }
コード例 #2
0
 private void checkExpression(ExpressionTree expression, Type implicitType) {
   if (implicitType.isPrimitive()) {
     checkForBoxing(expression);
   } else {
     checkForUnboxing(expression);
   }
 }
コード例 #3
0
 private static boolean autoboxing(Type argumentType, Type collectionParameterType) {
   return argumentType.isPrimitive()
       && ((JavaType) collectionParameterType).isPrimitiveWrapper()
       && isSubtypeOf(((JavaType) argumentType).primitiveWrapperType(), collectionParameterType);
 }
コード例 #4
0
 private static boolean isIntegerOrLongExpected(Type type) {
   return type.isPrimitive(Primitives.INT) || type.isPrimitive(Primitives.LONG);
 }