@Override public boolean matches(T t, VisitorState state) { Type type = getType(t); return type != null && type.isPrimitiveOrVoid(); } };
private boolean isIgnoredReturnType(JCMethodDecl method, VisitorState state) { Type returnType = method.sym.getReturnType(); // Methods returning a primitive cannot return null. Also ignore Void-returning methods as // the only valid Void value is null, so it's implied. // TODO(kmb): Technically we should assume NULL when we see a call to a method that returns Void return returnType.isPrimitiveOrVoid() || state.getTypes().isSameType(returnType, state.getTypeFromString("java.lang.Void")); }
@Override public boolean isPrimitiveOrVoid() { return underlyingType.isPrimitiveOrVoid(); } @Override
@Override public boolean isPrimitiveOrVoid() { return underlyingType.isPrimitiveOrVoid(); } @Override
qualifiedName = context.getTypeMappingTarget(qualifiedName); if (!isMapped && !type.isPrimitiveOrVoid()) { qualifiedName = context.getRootRelativeName(null, type.tsym);
@Override public boolean matches(T t, VisitorState state) { Type type = getType(t); return type != null && type.isPrimitiveOrVoid(); } };
private boolean isIgnoredReturnType(JCMethodDecl method, VisitorState state) { Type returnType = method.sym.getReturnType(); // Methods returning a primitive cannot return null. Also ignore Void-returning methods as // the only valid Void value is null, so it's implied. // TODO(kmb): Technically we should assume NULL when we see a call to a method that returns Void return returnType.isPrimitiveOrVoid() || state.getTypes().isSameType(returnType, state.getTypeFromString("java.lang.Void")); }
/** Convert tree into string object, unless it has already a * reference type.. */ JCExpression makeString(JCExpression tree) { if (!tree.type.isPrimitiveOrVoid()) { return tree; } else { Symbol valueOfSym = lookupMethod(tree.pos(), names.valueOf, syms.stringType, List.of(tree.type)); return make.App(make.QualIdent(valueOfSym), List.of(tree)); } }
/** Convert tree into string object, unless it has already a * reference type.. */ JCExpression makeString(JCExpression tree) { if (!tree.type.isPrimitiveOrVoid()) { return tree; } else { Symbol valueOfSym = lookupMethod(tree.pos(), names.valueOf, syms.stringType, List.of(tree.type)); return make.App(make.QualIdent(valueOfSym), List.of(tree)); } }
boolean compat = types.isSameType(rt1, rt2) || !rt1.isPrimitiveOrVoid() && !rt2.isPrimitiveOrVoid() && (types.covariantReturnType(rt1, rt2, types.noWarnings) || types.covariantReturnType(rt2, rt1, types.noWarnings)) ||
boolean compat = types.isSameType(rt1, rt2) || !rt1.isPrimitiveOrVoid() && !rt2.isPrimitiveOrVoid() && (types.covariantReturnType(rt1, rt2, types.noWarnings) || types.covariantReturnType(rt2, rt1, types.noWarnings)) ||
private void validateAnnotatedType(final JCTree errtree, final Type type) { if (type.isPrimitiveOrVoid()) { return;
private void validateAnnotatedType(final JCTree errtree, final Type type) { if (type.isPrimitiveOrVoid()) { return;