mirror of https://github.com/apache/druid.git
Fix ColumnSignature error message and jdk17 test issue. (#14538)
* Fix ColumnSignature error message and jdk17 test issue. On jdk17, the "problem" part of the error message could change from NullPointerException to: Cannot invoke "String.length()" because "s" is null Due to the new more-helpful NPEs in Java 17. This broke the expectation and led to test failures on this case. This patch fixes the problem by improving the error message so it isn't a generic NullPointerException. * Fix format.
This commit is contained in:
parent
037f09bef2
commit
dd78e00dc5
|
@ -50,7 +50,7 @@ class ColumnSignature
|
|||
|
||||
// Name must be nonnull, but type can be null (if the type is unknown)
|
||||
if (name == null || name.isEmpty()) {
|
||||
throw new IAE(name, "Column name must be non-empty");
|
||||
throw new IAE("Column name must be provided and non-empty");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1638,7 +1638,7 @@ public class CalciteInsertDmlTest extends CalciteIngestionDmlTest
|
|||
"general"
|
||||
)
|
||||
.expectMessageContains(
|
||||
"Cannot construct instance of `org.apache.druid.segment.column.ColumnSignature`, problem: `java.lang.NullPointerException`\n"
|
||||
"Cannot construct instance of `org.apache.druid.segment.column.ColumnSignature`, problem: Column name must be provided and non-empty"
|
||||
)
|
||||
)
|
||||
.verify();
|
||||
|
|
Loading…
Reference in New Issue