/** * Raises an {@link ArityException}, hidden as a {@link RuntimeException}, which allows throwing * it without an explicit throws declaration. The {@link ForeignAccess} methods (e.g. * <code> ForeignAccess.sendRead </code>) catch the exceptions and re-throw them as checked * exceptions. * * @param expectedArity the number of arguments expected by the foreign object * @param actualArity the number of provided by the foreign access * * @return the exception * @since 0.11 */ public static RuntimeException raise(int expectedArity, int actualArity) { CompilerDirectives.transferToInterpreter(); return silenceException(RuntimeException.class, new ArityException(expectedArity, actualArity)); }
/** * Raises an {@link ArityException}, hidden as a {@link RuntimeException}, which allows throwing * it without an explicit throws declaration. The {@link ForeignAccess} methods (e.g. * <code> ForeignAccess.sendRead </code>) catch the exceptions and re-throw them as checked * exceptions. * * @param expectedArity the number of arguments expected by the foreign object * @param actualArity the number of provided by the foreign access * * @return the exception * @since 0.11 */ public static RuntimeException raise(int expectedArity, int actualArity) { CompilerDirectives.transferToInterpreter(); return silenceException(RuntimeException.class, new ArityException(expectedArity, actualArity)); }