@@ -151,7 +151,7 @@ static Object[] unpackForeignArray(Object left, InteropLibrary lib, PForeignToPT
151
151
return data ;
152
152
}
153
153
} catch (UnsupportedMessageException | InvalidArrayIndexException e ) {
154
- // fall through
154
+ throw new IllegalStateException ( "object does not unpack as it claims to" );
155
155
}
156
156
return null ;
157
157
}
@@ -208,7 +208,7 @@ Object doComparisonBool(Object left, Object right,
208
208
try {
209
209
return op .executeObject (lib .asBoolean (left ), right );
210
210
} catch (UnsupportedMessageException e ) {
211
- return PNotImplemented . NOT_IMPLEMENTED ;
211
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
212
212
}
213
213
}
214
214
@@ -218,7 +218,7 @@ Object doComparisonLong(Object left, Object right,
218
218
try {
219
219
return op .executeObject (lib .asLong (left ), right );
220
220
} catch (UnsupportedMessageException e ) {
221
- return PNotImplemented . NOT_IMPLEMENTED ;
221
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
222
222
}
223
223
}
224
224
@@ -228,7 +228,7 @@ Object doComparisonDouble(Object left, Object right,
228
228
try {
229
229
return op .executeObject (lib .asDouble (left ), right );
230
230
} catch (UnsupportedMessageException e ) {
231
- return PNotImplemented . NOT_IMPLEMENTED ;
231
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
232
232
}
233
233
}
234
234
@@ -277,7 +277,7 @@ Object doComparisonStringR(Object left, Object right,
277
277
try {
278
278
return op .executeObject (right , lib .asString (left ));
279
279
} catch (UnsupportedMessageException e ) {
280
- return PNotImplemented . NOT_IMPLEMENTED ;
280
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
281
281
}
282
282
}
283
283
@@ -350,7 +350,7 @@ static Object doForeignArray(Object left, Object right,
350
350
try {
351
351
rightInt = lib .asInt (right );
352
352
} catch (UnsupportedMessageException e ) {
353
- return PNotImplemented . NOT_IMPLEMENTED ;
353
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
354
354
}
355
355
Object [] unpackForeignArray = unpackForeignArray (left , lib , convert );
356
356
if (unpackForeignArray != null ) {
@@ -466,7 +466,7 @@ Object doComparisonBool(Object left, Object right,
466
466
try {
467
467
return comparisonNode .executeBool (lib .asBoolean (left ), right );
468
468
} catch (UnsupportedMessageException e ) {
469
- return PNotImplemented . NOT_IMPLEMENTED ;
469
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
470
470
}
471
471
}
472
472
@@ -476,7 +476,7 @@ Object doComparisonLong(Object left, Object right,
476
476
try {
477
477
return comparisonNode .executeWith (lib .asLong (left ), right );
478
478
} catch (UnsupportedMessageException e ) {
479
- return PNotImplemented . NOT_IMPLEMENTED ;
479
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
480
480
}
481
481
}
482
482
@@ -486,7 +486,7 @@ Object doComparisonDouble(Object left, Object right,
486
486
try {
487
487
return comparisonNode .executeWith (lib .asDouble (left ), right );
488
488
} catch (UnsupportedMessageException e ) {
489
- return PNotImplemented . NOT_IMPLEMENTED ;
489
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
490
490
}
491
491
}
492
492
@@ -499,7 +499,7 @@ Object doComparison(@SuppressWarnings("unused") Object left, Object right,
499
499
@ SuppressWarnings ("unused" )
500
500
@ Fallback
501
501
public PNotImplemented doGeneric (Object left , Object right ) {
502
- return PNotImplemented . NOT_IMPLEMENTED ;
502
+ throw new IllegalStateException ( "object does not unpack as it claims to" ) ;
503
503
}
504
504
}
505
505
0 commit comments