public static boolean isPrimitive(@Nullable final TypeReference type) { return type != null && type.isPrimitive(); }
public static boolean isPrimitive(@Nullable final TypeReference type) { return type != null && type.isPrimitive(); }
public static boolean isPrimitive(@Nullable final TypeReference type) { return type != null && type.isPrimitive(); }
public static boolean isPrimitiveOrWrapper(@Nullable final TypeReference type) { if (type == null) { return false; } return MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(type).isPrimitive(); }
public static boolean isPrimitiveOrWrapper(@Nullable final TypeReference type) { if (type == null) { return false; } return MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(type).isPrimitive(); }
public static boolean isPrimitiveOrWrapper(@Nullable final TypeReference type) { if (type == null) { return false; } return MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(type).isPrimitive(); }
private static boolean eraseNotNeeded(final TypeReference type) { return type == null || type instanceof RawType || type.isPrimitive() || StringUtilities.equals(type.getInternalName(), CommonTypeReferences.String.getInternalName()); }
private static boolean eraseNotNeeded(final TypeReference type) { return type == null || type instanceof RawType || type.isPrimitive() || StringUtilities.equals(type.getInternalName(), CommonTypeReferences.String.getInternalName()); }
private static boolean eraseNotNeeded(final TypeReference type) { return type == null || type instanceof RawType || type.isPrimitive() || StringUtilities.equals(type.getInternalName(), CommonTypeReferences.String.getInternalName()); }
private boolean isCastRequired(final TypeReference targetType, final TypeReference sourceType, final boolean exactMatch) { if (targetType == null || sourceType == null) { return false; } if (targetType.isPrimitive()) { return sourceType.getSimpleType() != targetType.getSimpleType(); } if (exactMatch) { return !MetadataHelper.isSameType(targetType, sourceType, true); } return !MetadataHelper.isAssignableFrom(targetType, sourceType); }
@Override public TypeReference visitArrayType(final ArrayType t, final Void ignored) { final TypeReference et = getElementType(t); if (et.isPrimitive() || isSameType(et, BuiltinTypes.Object)) { return arraySuperType(et); } final TypeReference superType = getSuperType(et); return superType != null ? superType.makeArrayType() : null; }
private boolean isCastRequired(final TypeReference targetType, final TypeReference sourceType, final boolean exactMatch) { if (targetType == null || sourceType == null) { return false; } if (targetType.isPrimitive()) { return sourceType.getSimpleType() != targetType.getSimpleType(); } if (exactMatch) { return !MetadataHelper.isSameType(targetType, sourceType, true); } return !MetadataHelper.isAssignableFrom(targetType, sourceType); }
private boolean isCastRequired(final TypeReference targetType, final TypeReference sourceType, final boolean exactMatch) { if (targetType == null || sourceType == null) { return false; } if (targetType.isPrimitive()) { return sourceType.getSimpleType() != targetType.getSimpleType(); } if (exactMatch) { return !MetadataHelper.isSameType(targetType, sourceType, true); } return !MetadataHelper.isAssignableFrom(targetType, sourceType); }
@Override public TypeReference visitArrayType(final ArrayType t, final Void ignored) { final TypeReference et = getElementType(t); assert et != null; if (et.isPrimitive() || isSameType(et, BuiltinTypes.Object)) { return arraySuperType(et); } final TypeReference superType = getSuperType(et); return superType != null ? superType.makeArrayType() : null; }
@Override public TypeReference visitArrayType(final ArrayType t, final Void ignored) { final TypeReference et = getElementType(t); if (et.isPrimitive() || isSameType(et, BuiltinTypes.Object)) { return arraySuperType(et); } final TypeReference superType = getSuperType(et); return superType != null ? superType.makeArrayType() : null; }
private void removeUnboxingForCondition( final InvocationExpression e, final MemberReferenceExpression target, final ConditionalExpression parent) { final boolean leftSide = parent.getTrueExpression().isAncestorOf(e); final Expression otherSide = leftSide ? parent.getFalseExpression() : parent.getTrueExpression(); final ResolveResult otherResult = _resolver.apply(otherSide); if (otherResult == null || otherResult.getType() == null || !otherResult.getType().isPrimitive()) { return; } performUnboxingRemoval(e, target); }
private void removeUnboxingForCondition( final InvocationExpression e, final MemberReferenceExpression target, final ConditionalExpression parent) { final boolean leftSide = parent.getTrueExpression().isAncestorOf(e); final Expression otherSide = leftSide ? parent.getFalseExpression() : parent.getTrueExpression(); final ResolveResult otherResult = _resolver.apply(otherSide); if (otherResult == null || otherResult.getType() == null || !otherResult.getType().isPrimitive()) { return; } performUnboxingRemoval(e, target); }
@Override public Void visitSimpleType(final SimpleType node, final Void ignored) { startNode(node); final TypeReference typeReference = node.getUserData(Keys.TYPE_REFERENCE); if (typeReference != null && typeReference.isPrimitive()) { writeKeyword(typeReference.getSimpleName()); } else { writeIdentifier(node.getIdentifier()); } writeTypeArguments(node.getTypeArguments()); endNode(node); return null; }
@Override public Void visitSimpleType(final SimpleType node, final Void ignored) { startNode(node); final TypeReference typeReference = node.getUserData(Keys.TYPE_REFERENCE); if (typeReference != null && typeReference.isPrimitive()) { writeKeyword(typeReference.getSimpleName()); } else { writeIdentifier(node.getIdentifier()); } writeTypeArguments(node.getTypeArguments()); endNode(node); return null; }
@Override public Boolean visitArrayType(final ArrayType t, final TypeReference s) { if (s.isArray()) { final TypeReference et = getElementType(t); final TypeReference es = getElementType(s); if (et.isPrimitive()) { return isSameType(et, es); } return isSubTypeNoCapture(et, es); } final String sName = s.getInternalName(); return StringUtilities.equals(sName, "java/lang/Object") || StringUtilities.equals(sName, "java/lang/Cloneable") || StringUtilities.equals(sName, "java/io/Serializable"); }