# HG changeset patch # User Jaroslav Tulach # Date 1444978072 -7200 # Node ID 3f2737e9e4e10f747a52396d3a4bfdb05cfc8742 # Parent 1d60440b03a8c942e7707a2d833427b0c5b227c0 The method documentation says one should throw ClassCastException when the value cannot be converted diff -r 1d60440b03a8 -r 3f2737e9e4e1 truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java --- a/truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java Thu Oct 15 10:01:44 2015 +0200 +++ b/truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java Fri Oct 16 08:47:52 2015 +0200 @@ -742,7 +742,7 @@ if (JAVA_INTEROP_ENABLED) { return JavaInterop.asJavaObject(representation, (TruffleObject) obj); } - throw new IllegalArgumentException("Value cannot be represented as " + representation.getName()); + throw new ClassCastException("Value cannot be represented as " + representation.getName()); } /**