From 8d75371db8e14ee4c938aa4b7f8889fd2890de69 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Mon, 9 Oct 2023 18:42:10 +0000 Subject: [PATCH] fixcheckstyle --- .../sql/calcite/BaseCalciteQueryTest.java | 3 ++- .../sql/calcite/DrillWindowQueryTest.java | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index 532896909217..9519fb1c7ab5 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -126,6 +126,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Properties; import java.util.Set; @@ -1384,7 +1385,7 @@ public void verify(String sql, List results) public static void displayResults(String name, List results) { PrintStream out = System.out; - out.printf("-- %s results --", name); + out.printf(Locale.ENGLISH, "-- %s results --", name); for (int rowIndex = 0; rowIndex < results.size(); rowIndex++) { printArray(results.get(rowIndex), out); if (rowIndex < results.size() - 1) { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java index 0f306c6d0e1f..1fcc46c530a4 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java @@ -50,7 +50,6 @@ import org.apache.druid.segment.join.JoinableFactoryWrapper; import org.apache.druid.segment.writeout.OnHeapMemorySegmentWriteOutMediumFactory; import org.apache.druid.sql.calcite.NotYetSupported.Modes; -import static org.apache.druid.sql.calcite.NotYetSupported.Modes.*; import org.apache.druid.sql.calcite.NotYetSupported.NotYetSupportedProcessor; import org.apache.druid.sql.calcite.planner.PlannerContext; import org.apache.druid.sql.calcite.util.SpecificSegmentsQuerySegmentWalker; @@ -145,7 +144,7 @@ public void ensureAllDeclared() throws Exception if (allCases.remove(ann.value() + ".q")) { continue; } - fail(String.format("Testcase [%s] references invalid file [%s].", method.getName(), ann.value())); + fail(String.format(Locale.ENGLISH, "Testcase [%s] references invalid file [%s].", method.getName(), ann.value())); } for (String string : allCases) { @@ -207,7 +206,7 @@ public DrillTestCase(String filename) } catch (Exception e) { throw new RuntimeException( - String.format("Encountered exception while loading testcase [%s]", filename), + String.format(Locale.ENGLISH, "Encountered exception while loading testcase [%s]", filename), e); } } @@ -415,7 +414,7 @@ private static List parseResults(RowSignature rs, List resul newVal = val; break; case LONG: - newVal = parseLongValue(val); + newVal = parseLongValue(val); break; case DOUBLE: newVal = Numbers.parseDoubleObject(val); @@ -438,23 +437,27 @@ private static Object parseLongValue(final String val) } try { return Long.parseLong(val); - } catch (NumberFormatException e) { + } + catch (NumberFormatException e) { } try { double d = Double.parseDouble(val); return (long) d; - } catch (NumberFormatException e) { + } + catch (NumberFormatException e) { } try { LocalTime v = LocalTime.parse(val); return v.getMillisOfDay(); - } catch (Exception e) { + } + catch (Exception e) { } Function parser = TimestampParser.createTimestampParser("auto"); try { DateTime v = parser.apply(val); return v.getMillis(); - } catch (IllegalArgumentException iae) { + } + catch (IllegalArgumentException iae) { } throw new RuntimeException("Can't parse input!"); }