@Override public final boolean test(final T t) { return MetadataHelper.isAssignableFrom(t, sourceType); } };
@Override public final boolean test(final T t) { return MetadataHelper.isAssignableFrom(targetType, t); } };
@Override public final boolean test(final T t) { return MetadataHelper.isAssignableFrom(targetType, t); } };
@Override public final boolean test(final T t) { return MetadataHelper.isAssignableFrom(targetType, t); } };
@Override public final boolean test(final T t) { return MetadataHelper.isAssignableFrom(t, sourceType); } };
@Override public final boolean test(final T t) { return MetadataHelper.isAssignableFrom(t, 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); }
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); }
isMatch = MetadataHelper.isAssignableFrom( _expressionType, result.getType(),
isMatch = MetadataHelper.isAssignableFrom( _expressionType, result.getType(),
isMatch = MetadataHelper.isAssignableFrom( _expressionType, result.getType(),
protected void processPossibleTypeCast(final Expression rightExpression, @Nullable final TypeReference leftType) { if (leftType == null) { return; } final Expression r = removeParentheses(rightExpression); if (r instanceof CastExpression) { final AstType castAstType = ((CastExpression) r).getType(); final TypeReference castType = castAstType != null ? castAstType.toTypeReference() : null; final Expression castOperand = ((CastExpression) r).getExpression(); if (castOperand != null && !castOperand.isNull() && castType != null) { final TypeReference operandType = getType(castOperand); if (operandType != null) { if (MetadataHelper.isAssignableFrom(leftType, operandType, false)) { addToResults((CastExpression) r, false); } else { final TypeReference unboxedCastType = MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(castType); final TypeReference unboxedLeftType = MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(leftType); if (castOperand instanceof PrimitiveExpression && TypeUtilities.isValidPrimitiveLiteralAssignment(unboxedCastType, ((PrimitiveExpression) castOperand).getValue()) && TypeUtilities.isValidPrimitiveLiteralAssignment(unboxedLeftType, ((PrimitiveExpression) castOperand).getValue())) { addToResults((CastExpression) r, true); } } } } } }
protected void processPossibleTypeCast(final Expression rightExpression, @Nullable final TypeReference leftType) { if (leftType == null) { return; } final Expression r = removeParentheses(rightExpression); if (r instanceof CastExpression) { final AstType castAstType = ((CastExpression) r).getType(); final TypeReference castType = castAstType != null ? castAstType.toTypeReference() : null; final Expression castOperand = ((CastExpression) r).getExpression(); if (castOperand != null && !castOperand.isNull() && castType != null) { final TypeReference operandType = getType(castOperand); if (operandType != null) { if (MetadataHelper.isAssignableFrom(leftType, operandType, false)) { addToResults((CastExpression) r, false); } else { final TypeReference unboxedCastType = MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(castType); final TypeReference unboxedLeftType = MetadataHelper.getUnderlyingPrimitiveTypeOrSelf(leftType); if (castOperand instanceof PrimitiveExpression && TypeUtilities.isValidPrimitiveLiteralAssignment(unboxedCastType, ((PrimitiveExpression) castOperand).getValue()) && TypeUtilities.isValidPrimitiveLiteralAssignment(unboxedLeftType, ((PrimitiveExpression) castOperand).getValue())) { addToResults((CastExpression) r, true); } } } } } }
if (MetadataHelper.isAssignableFrom(leftType, operandType, false)) { addToResults((CastExpression) r, false); return;
if (isAssignableFrom(target, source, false)) { return ConversionType.IMPLICIT;
if (isAssignableFrom(target, source, false)) { return ConversionType.IMPLICIT;
if (isAssignableFrom(target, source, false)) { return ConversionType.IMPLICIT;
valueResult.getType() != null) { if (MetadataHelper.isAssignableFrom(declaringType, valueResult.getType())) { return null;
valueResult.getType() != null) { if (MetadataHelper.isAssignableFrom(declaringType, valueResult.getType())) { return null;