Skip to content
Permalink
Browse files
fix: getTypeMap() returning null (#1781)
* fix null typemap
  • Loading branch information
davecramer committed May 11, 2020
1 parent 4ddbcb7 commit f3abb4eb19357ac353d4a1e59d2920135619ad9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
@@ -397,7 +397,7 @@ public TimestampUtils getTimestampUtils() {
/**
* The current type mappings.
*/
protected Map<String, Class<?>> typemap;
protected Map<String, Class<?>> typemap = new HashMap<>();

@Override
public Statement createStatement() throws SQLException {
@@ -508,6 +508,18 @@ public void testDoubleClose() throws Exception {
con.close();
}

/**
* Make sure that type map is empty and not null
*/
@Test
public void testGetTypeMapEmpty() throws Exception {
con = TestUtil.openDB();
Map typeMap = con.getTypeMap();
assertNotNull(typeMap);
assertTrue("TypeMap should be empty", typeMap.isEmpty());
con.close();
}

private static void assertStringContains(String orig, String toContain) {
if (!orig.contains(toContain)) {
fail("expected [" + orig + ']' + "to contain [" + toContain + "].");

0 comments on commit f3abb4e

Please sign in to comment.