From dac1d2df02481e252be427a7250bbd4ab2a48287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Fri, 9 Feb 2024 12:21:15 +0100 Subject: [PATCH] Add final to instanceof variable declarations --- .../nodes/plugins/ffi/InterpreterProxy.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java index c4a4a1535..3ff3820e7 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java @@ -277,7 +277,7 @@ private static long returnNull() { //////////////////////// private long objectToInteger(final Object object) { - if (object instanceof Long longObject) { + if (object instanceof final Long longObject) { return longObject; } LogUtils.PRIMITIVES.severe(() -> "Object to long called with non-Long: " + object); @@ -286,7 +286,7 @@ private long objectToInteger(final Object object) { } private double objectToFloat(final Object object) { - if (object instanceof FloatObject floatObject) { + if (object instanceof final FloatObject floatObject) { return floatObject.getValue(); } LogUtils.PRIMITIVES.severe(() -> "Object to long called with non-FloatObject: " + object); @@ -333,7 +333,7 @@ private long instanceOfCheck(final long oop, final Class klass) { private long nativeObjectCheck(final long oop, final Predicate predicate) { final Object object = objectRegistryGet(oop); - if (object instanceof NativeObject nativeObject) { + if (object instanceof final NativeObject nativeObject) { return returnBoolean(predicate.test(nativeObject)); } return returnVoid(); @@ -345,7 +345,7 @@ private long nativeObjectCheck(final long oop, final Predicate pre private long booleanValueOf(final long oop) { final Object object = objectRegistryGet(oop); - if (object instanceof Boolean bool) { + if (object instanceof final Boolean bool) { return returnBoolean(bool); } primitiveFail(); @@ -353,7 +353,7 @@ private long booleanValueOf(final long oop) { } private long byteSizeOf(final long oop) { - if (objectRegistryGet(oop) instanceof NativeObject nativeObject) { + if (objectRegistryGet(oop) instanceof final NativeObject nativeObject) { return NativeObjectStorage.from(nativeObject).byteSizeOf(); } // type is not supported (yet) @@ -474,7 +474,7 @@ private long fetchPointerofObject(final long index, final long oop) { } private NativeObjectStorage firstIndexableField(final long oop) { - if (objectRegistryGet(oop) instanceof NativeObject nativeObject) { + if (objectRegistryGet(oop) instanceof final NativeObject nativeObject) { final NativeObjectStorage storage = NativeObjectStorage.from(nativeObject); postPrimitiveCleanups.add(storage); return storage; @@ -488,7 +488,7 @@ private double floatValueOf(final long oop) { private long instantiateClassindexableSize(final long classPointer, final long size) { final Object object = objectRegistryGet(classPointer); - if (object instanceof ClassObject classObject) { + if (object instanceof final ClassObject classObject) { final AbstractSqueakObject newObject = SqueakObjectNewNode.executeUncached(context, classObject, (int) size); return oopFor(newObject); } @@ -529,10 +529,10 @@ private long isPointers(final long oop) { private long isPositiveMachineIntegerObject(final long oop) { final Object object = objectRegistryGet(oop); - if (object instanceof Long integer) { + if (object instanceof final Long integer) { return returnBoolean(integer >= 0L); } - if (object instanceof LargeIntegerObject largeInteger) { + if (object instanceof final LargeIntegerObject largeInteger) { return returnBoolean(largeInteger.isZeroOrPositive() && largeInteger.fitsIntoLong()); } return returnBoolean(false);