feedback from code review

This commit is contained in:
Tim Chamberlain
2025-03-25 12:16:48 -05:00
parent 133e507c93
commit 7af23e52d6
5 changed files with 19 additions and 5 deletions

View File

@ -56,7 +56,6 @@ public class ValueUtils
private static final DateTimeFormatter dateTimeFormatter_yyyyMMddWithDashes = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private static final DateTimeFormatter dateTimeFormatter_yyyyMMddWithDashes = DateTimeFormatter.ofPattern("yyyy-MM-dd");
private static final DateTimeFormatter dateTimeFormatter_MdyyyyWithSlashes = DateTimeFormatter.ofPattern("M/d/yyyy"); private static final DateTimeFormatter dateTimeFormatter_MdyyyyWithSlashes = DateTimeFormatter.ofPattern("M/d/yyyy");
private static final DateTimeFormatter dateTimeFormatter_MdyyWithSlashes = DateTimeFormatter.ofPattern("M/d/yyyy");
private static final DateTimeFormatter dateTimeFormatter_yyyyMMdd = DateTimeFormatter.ofPattern("yyyyMMdd"); private static final DateTimeFormatter dateTimeFormatter_yyyyMMdd = DateTimeFormatter.ofPattern("yyyyMMdd");
@ -451,7 +450,7 @@ public class ValueUtils
private static LocalDate tryLocalDateParsers(String s) private static LocalDate tryLocalDateParsers(String s)
{ {
DateTimeParseException lastException = null; DateTimeParseException lastException = null;
for(DateTimeFormatter dateTimeFormatter : List.of(dateTimeFormatter_yyyyMMddWithDashes, dateTimeFormatter_MdyyyyWithSlashes, dateTimeFormatter_yyyyMMdd, dateTimeFormatter_MdyyWithSlashes)) for(DateTimeFormatter dateTimeFormatter : List.of(dateTimeFormatter_yyyyMMddWithDashes, dateTimeFormatter_MdyyyyWithSlashes, dateTimeFormatter_yyyyMMdd))
{ {
try try
{ {

View File

@ -18,7 +18,6 @@
</File> </File>
</Appenders> </Appenders>
<Loggers> <Loggers>
<Logger name="org.apache.log4j.xml" additivity="false" />
<Logger name="org.mongodb.driver" level="WARN" /> <Logger name="org.mongodb.driver" level="WARN" />
<Logger name="org.eclipse.jetty" level="INFO" /> <Logger name="org.eclipse.jetty" level="INFO" />
<Logger name="io.javalin" level="INFO" /> <Logger name="io.javalin" level="INFO" />

View File

@ -334,4 +334,20 @@ class StringUtilsTest extends BaseTest
assertEquals("a", StringUtils.emptyToNull("a")); assertEquals("a", StringUtils.emptyToNull("a"));
} }
/*******************************************************************************
**
*******************************************************************************/
@Test
void testAppendIncrementingSuffix()
{
assertEquals("test (1)", StringUtils.appendIncrementingSuffix("test"));
assertEquals("test (2)", StringUtils.appendIncrementingSuffix("test (1)"));
assertEquals("test (a) (1)", StringUtils.appendIncrementingSuffix("test (a)"));
assertEquals("test (a32) (1)", StringUtils.appendIncrementingSuffix("test (a32)"));
assertEquals("test ((2)) (1)", StringUtils.appendIncrementingSuffix("test ((2))"));
assertEquals("test ((2)) (101)", StringUtils.appendIncrementingSuffix("test ((2)) (100)"));
}
} }

View File

@ -362,4 +362,4 @@ class ValueUtilsTest extends BaseTest
assertEquals(QFieldType.TIME, ValueUtils.inferQFieldTypeFromValue(LocalTime.now(), null)); assertEquals(QFieldType.TIME, ValueUtils.inferQFieldTypeFromValue(LocalTime.now(), null));
} }
} }

View File

@ -212,7 +212,7 @@ public class BaseAPIActionUtil
catch(QNotFoundException qnfe) catch(QNotFoundException qnfe)
{ {
LOG.info("Not found", qnfe); LOG.info("Not found", qnfe);
throw new QException("Error executing get: " + qnfe.getMessage(), qnfe); throw (qnfe);
} }
catch(Exception e) catch(Exception e)
{ {