@@ -114,12 +114,12 @@ protected boolean needsSpecialTranslation(Throwable e) {
114
114
private static RaiseException doTranslateSpecial (Node node , Throwable e ) {
115
115
if (e instanceof TruffleString .IllegalByteArrayLengthException ) {
116
116
return new RaiseException (getContext (node ), coreExceptions (node ).argumentError (e .getMessage (), node ));
117
- } else if (e instanceof UnsupportedSpecializationException ) {
117
+ } else if (e instanceof UnsupportedSpecializationException unsupported ) {
118
118
return new RaiseException (getContext (node ),
119
- translateUnsupportedSpecialization (node , getContext (node ), ( UnsupportedSpecializationException ) e ));
120
- } else if (e instanceof StackOverflowError ) {
119
+ translateUnsupportedSpecialization (unsupported . getNode () , getContext (node ), unsupported ));
120
+ } else if (e instanceof StackOverflowError stackOverflowError ) {
121
121
return new RaiseException (getContext (node ),
122
- translateStackOverflow (node , getContext (node ), ( StackOverflowError ) e ));
122
+ translateStackOverflow (node , getContext (node ), stackOverflowError ));
123
123
} else {
124
124
return new RaiseException (getContext (node ),
125
125
translateOutOfMemory (node , getContext (node ), (OutOfMemoryError ) e ));
@@ -175,16 +175,14 @@ public static StringBuilder argumentsToString(StringBuilder builder, Object[] ar
175
175
176
176
if (value == null ) {
177
177
builder .append ("null" );
178
- } else if (value instanceof RubyDynamicObject ) {
179
- final RubyDynamicObject dynamicObject = (RubyDynamicObject ) value ;
178
+ } else if (value instanceof RubyDynamicObject dynamicObject ) {
180
179
181
180
builder .append (dynamicObject .getLogicalClass ().fields .getName ());
182
181
builder .append ("(" );
183
182
builder .append (value .getClass ().getName ());
184
183
builder .append (")" );
185
184
186
- if (value instanceof RubyArray ) {
187
- final RubyArray array = (RubyArray ) value ;
185
+ if (value instanceof RubyArray array ) {
188
186
builder .append ("[" );
189
187
190
188
if (array .getStore () == null ) {
0 commit comments