Logo Search packages:      
Sourcecode: janino version File versions  Download package

boolean org::codehaus::janino::UnitCompiler::isMethodInvocationConvertible ( IClass  sourceType,
IClass  targetType,
boolean  boxingPermitted 
) throws CompileException [inline, private]

Check if "method invocation conversion" (5.3) is possible.

Definition at line 5956 of file UnitCompiler.java.

                              {

        // 5.3 Identity conversion.
        if (sourceType == targetType) return true;

        // 5.3 Widening primitive conversion.
        if (this.isWideningPrimitiveConvertible(sourceType, targetType)) return true;

        // 5.3 Widening reference conversion.
        if (this.isWideningReferenceConvertible(sourceType, targetType)) return true;

        // JLS3 5.3 A boxing conversion (JLS3 5.1.7) optionally followed by widening reference conversion.
        if (boxingPermitted) {
            IClass boxedType = this.isBoxingConvertible(sourceType);
            if (boxedType != null) {
                return (
                    this.isIdentityConvertible(boxedType, targetType) ||
                    this.isWideningReferenceConvertible(boxedType, targetType)
                );
            }
        }

        // JLS3 5.3 An unboxing conversion (JLS3 5.1.8) optionally followed by a widening primitive conversion.
        if (boxingPermitted) {
            IClass unboxedType = this.isUnboxingConvertible(sourceType);
            if (unboxedType != null) {
                return (
                    this.isIdentityConvertible(unboxedType, targetType) ||
                    this.isWideningPrimitiveConvertible(unboxedType, targetType)
                );
            }
        }

        // 5.3 TODO: FLOAT or DOUBLE value set conversion

        return false;
    }


Generated by  Doxygen 1.6.0   Back to index