Examples of UnexpectedResultException


Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

                final long value = super.executeLongFixnum(frame);

                if (canLower(value)) {
                    return lower(value);
                } else {
                    throw new UnexpectedResultException(value);
                }
            } else {
                return super.executeIntegerFixnum(frame);
            }
        } catch (UnexpectedResultException e) {
            if (e.getResult() instanceof Long && canLower((long) e.getResult())) {
                hasNeededToLowerLongFixnum = true;
                return lower((long) e.getResult());
            } else if (e.getResult() instanceof RubyRange.LongFixnumRange && canLower((RubyRange.LongFixnumRange) e.getResult())) {
                hasNeededToLowerLongFixnumRange = true;
                throw new UnexpectedResultException(lower((RubyRange.LongFixnumRange) e.getResult()));
            } else {
                throw e;
            }
        }
    }
View Full Code Here

Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

                final RubyRange.LongFixnumRange range = super.executeLongFixnumRange(frame);

                if (canLower(range)) {
                    return lower(range);
                } else {
                    throw new UnexpectedResultException(range);
                }
            } else {
                return super.executeIntegerFixnumRange(frame);
            }
        } catch (UnexpectedResultException e) {
            if (e.getResult() instanceof Long && canLower((long) e.getResult())) {
                hasNeededToLowerLongFixnum = true;
                throw new UnexpectedResultException(lower((long) e.getResult()));
            } else if (e.getResult() instanceof RubyRange.LongFixnumRange && canLower((RubyRange.LongFixnumRange) e.getResult())) {
                hasNeededToLowerLongFixnumRange = true;
                return lower((RubyRange.LongFixnumRange) e.getResult());
            } else {
                throw e;
View Full Code Here

Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

        try {
            return super.executeUndefinedPlaceholder(frame);
        } catch (UnexpectedResultException e) {
            if (e.getResult() instanceof Long && canLower((long) e.getResult())) {
                hasNeededToLowerLongFixnum = true;
                throw new UnexpectedResultException(lower((long) e.getResult()));
            } else if (e.getResult() instanceof RubyRange.LongFixnumRange && canLower((RubyRange.LongFixnumRange) e.getResult())) {
                hasNeededToLowerLongFixnumRange = true;
                throw new UnexpectedResultException(e.getResult());
            } else {
                throw e;
            }
        }
    }
View Full Code Here

Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

        Object result = execute(object);

        if (result instanceof Integer) {
            return (int) result;
        } else {
            throw new UnexpectedResultException(result);
        }
    }
View Full Code Here

Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

        Object result = execute(object);

        if (result instanceof Long) {
            return (long) result;
        } else {
            throw new UnexpectedResultException(result);
        }
    }
View Full Code Here

Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

        Object result = execute(object);

        if (result instanceof Double) {
            return (double) result;
        } else {
            throw new UnexpectedResultException(result);
        }
    }
View Full Code Here

Examples of com.oracle.truffle.api.nodes.UnexpectedResultException

    public long readLong(ObjectStorage object, boolean condition) throws UnexpectedResultException {
        if (isSet(object)) {
            // TODO(CS): unsafeGetInt has a problem under compilation - pass condition as false and location as null for now
            return CompilerDirectives.unsafeGetInt(object, offset, false /*condition*/, null /*this*/);
        } else {
            throw new UnexpectedResultException(null);
        }
    }
View Full Code Here

Examples of fi.evident.dalesbred.UnexpectedResultException

    public Map<K, V> process(@NotNull ResultSet resultSet) throws SQLException {
        Map<K,V> result = new LinkedHashMap<K,V>();

        NamedTypeList types = ResultSetUtils.getTypes(resultSet.getMetaData());
        if (types.size() != 2)
            throw new UnexpectedResultException("Expected ResultSet with 2 columns, but got " + types.size() + " columns.");

        TypeConversion<Object, K> keyConversion = getConversion(types.getType(0), keyType);
        TypeConversion<Object, V> valueConversion = getConversion(types.getType(1), valueType);

        while (resultSet.next()) {
View Full Code Here

Examples of fi.evident.dalesbred.UnexpectedResultException

            T value = ctor.instantiate(instantiatorArguments);
            if (value != null || allowNulls)
                result.add(value);
            else
                throw new UnexpectedResultException("Expected " + cl.getName() + ", but got null");
        }

        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.