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; }
private void checkExpression(ExpressionTree expression, Type implicitType) { if (implicitType.isPrimitive()) { checkForBoxing(expression); } else { checkForUnboxing(expression); } }
private static boolean autoboxing(Type argumentType, Type collectionParameterType) { return argumentType.isPrimitive() && ((JavaType) collectionParameterType).isPrimitiveWrapper() && isSubtypeOf(((JavaType) argumentType).primitiveWrapperType(), collectionParameterType); }
private static boolean isIntegerOrLongExpected(Type type) { return type.isPrimitive(Primitives.INT) || type.isPrimitive(Primitives.LONG); }