From b0dd589d29e1be95b519c224f5f256d217d2c661 Mon Sep 17 00:00:00 2001 From: Meron Date: Thu, 21 Sep 2023 14:45:36 +0200 Subject: [PATCH] [cleanup] Fixed some smells reported by SonarCube --- .../core/scenes/delegates/CoordinateGridDelegate.java | 2 +- .../core/scenes/delegates/CoordinateGridDelegateTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegate.java b/src/main/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegate.java index 2105be033..ff40bd092 100644 --- a/src/main/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegate.java +++ b/src/main/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegate.java @@ -63,7 +63,7 @@ public void postActivation() { } private void drawCoordinateText(final int x, final int y, final int value, final int deltaX, final int deltaY) { - var text = textFactory.createText(Integer.valueOf(value).toString(), TEXT_COLOR); + var text = textFactory.createText(Integer.toString(value), TEXT_COLOR); text.setLayoutX((double) x + deltaX); text.setLayoutY((double) y + deltaY); pane.getChildren().add(text); diff --git a/src/test/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegateTest.java b/src/test/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegateTest.java index f0f6fb2c8..a64a6a103 100644 --- a/src/test/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegateTest.java +++ b/src/test/java/com/github/hanyaeger/core/scenes/delegates/CoordinateGridDelegateTest.java @@ -73,7 +73,7 @@ void postActivationDrawsOnlyOriginOfCoordinateGridIfWidthHeightIsMinimal() { sut.postActivation(); // Assert - verify(textFactoryMock, times(2)).createText(eq("0"), eq(CoordinateGridDelegate.TEXT_COLOR)); + verify(textFactoryMock, times(2)).createText("0", CoordinateGridDelegate.TEXT_COLOR); } @Test @@ -99,7 +99,7 @@ void postActivationDrawsOriginOfCoordinateGrid() { sut.postActivation(); // Assert - verify(textFactoryMock, times(2)).createText(eq("0"), eq(CoordinateGridDelegate.TEXT_COLOR)); + verify(textFactoryMock, times(2)).createText("0", CoordinateGridDelegate.TEXT_COLOR); } @Test