From 215f8403a6c4a131b9592457fd95a280274237de Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Thu, 23 Sep 2021 11:16:04 -0500 Subject: Fix code quality issues --- .../src/main/java/org/sonar/test/JsonComparison.java | 6 +++--- .../main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sonar-testing-harness') diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/JsonComparison.java b/sonar-testing-harness/src/main/java/org/sonar/test/JsonComparison.java index a12bc1f5ef4..98d49ec376a 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/JsonComparison.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/JsonComparison.java @@ -73,7 +73,7 @@ class JsonComparison { return compare(expectedJson, actualJson); } - private Object parse(String s) { + private static Object parse(String s) { try { JSONParser parser = new JSONParser(); return parser.parse(s); @@ -108,11 +108,11 @@ class JsonComparison { return compareBooleans((Boolean) expectedObject, (Boolean) actualObject); } - private boolean compareBooleans(Boolean expected, Boolean actual) { + private static boolean compareBooleans(Boolean expected, Boolean actual) { return expected.equals(actual); } - private boolean compareNumbers(Number expected, Number actual) { + private static boolean compareNumbers(Number expected, Number actual) { double d1 = expected.doubleValue(); double d2 = actual.doubleValue(); if (Double.compare(d1, d2) == 0) { diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java b/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java index fbb00f7ce5b..457ff104627 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java @@ -105,7 +105,7 @@ public class BundleSynchronizedMatcher extends BaseMatcher { return details; } - private void print(String title, SortedMap translations, StringBuilder to) { + private static void print(String title, SortedMap translations, StringBuilder to) { if (!translations.isEmpty()) { to.append(title); for (Map.Entry entry : translations.entrySet()) { -- cgit v1.2.3