Skip to content

Commit

Permalink
Prevent NoSuchElementException when attempting to parse the EJB clien…
Browse files Browse the repository at this point in the history
…t configuration
  • Loading branch information
fjuma committed Sep 27, 2016
1 parent 6065026 commit d983b2d
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ private static EJBClientContext loadConfiguration() {
}

private static void parseEJBClientConfiguration(final ConfigurationXMLStreamReader streamReader, final EJBClientContext.Builder builder) throws ConfigXMLParseException {
if (streamReader.nextTag() == START_ELEMENT) {
if (! streamReader.getNamespaceURI().equals(NS_EJB_CLIENT_3_0) || ! streamReader.getLocalName().equals("jboss-ejb-client")) {
throw streamReader.unexpectedElement();
if (streamReader.hasNext()) {
if (streamReader.nextTag() == START_ELEMENT) {
if (! streamReader.getNamespaceURI().equals(NS_EJB_CLIENT_3_0) || ! streamReader.getLocalName().equals("jboss-ejb-client")) {
throw streamReader.unexpectedElement();
}
parseEJBClientType(streamReader, builder);
return;
}
parseEJBClientType(streamReader, builder);
return;
throw streamReader.unexpectedContent();
}
throw streamReader.unexpectedContent();
}

private static void parseEJBClientType(final ConfigurationXMLStreamReader streamReader, final EJBClientContext.Builder builder) throws ConfigXMLParseException {
Expand Down

0 comments on commit d983b2d

Please sign in to comment.