Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit a8c063a

Browse files
EricTerry Smith
authored andcommitted
Adds throwing an exception in config XML does not have a root config element in a recognized namespace. Suppresses a compiler warning.
1 parent 1ae08d6 commit a8c063a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/java/com/t11e/discovery/datatool/ConfigurationManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ private GenericApplicationContext createApplicationContext(final InputStream is)
199199
final String prefix = namespacesByUri.get(document.getRootElement().getNamespaceURI());
200200
ns = prefix == null ? "" : (prefix + ":");
201201
}
202+
203+
if (document.selectSingleNode("/c:config".replace("c:", ns)) == null)
204+
{
205+
throw new RuntimeException("Missing root config element. Did you specify a namespace?");
206+
}
207+
202208
for (final Node node : (List<Node>) document.selectNodes("/c:config/c:dataSources/c:dataSource".replace("c:", ns)))
203209
{
204210
final String name = node.valueOf("@name");

src/main/java/com/t11e/discovery/datatool/SqlChangesetProfileService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public Date[] getChangesetProfileDateRange(final String profile,
4141
return result;
4242
}
4343

44+
@SuppressWarnings("unchecked")
4445
private Date[] getChangesetProfileDateRange(final String profile)
4546
{
4647
Date[] startEnd;

0 commit comments

Comments
 (0)