Skip to content

Commit

Permalink
ELY-2594 Changed switch to if-else to increase readability for Elytro…
Browse files Browse the repository at this point in the history
…nXmlParser
  • Loading branch information
Learner045 authored and PrarthonaPaul committed Oct 16, 2023
1 parent 8da9642 commit 9a42806
Showing 1 changed file with 4 additions and 6 deletions.
Expand Up @@ -1084,12 +1084,10 @@ static <C> ExceptionSupplier<RuleNode<C>, ConfigXMLParseException> parseRulesTyp
final int tag = reader.nextTag();
if (tag == START_ELEMENT) {
checkElementNamespace(reader, xmlVersion);
switch (reader.getLocalName()) {
case "rule": {
rulesList.add(ruleParseFunction.apply(reader, configurations));
break;
}
default: throw reader.unexpectedElement();
if (reader.getLocalName().equals("rule")) {
rulesList.add(ruleParseFunction.apply(reader, configurations));
} else {
throw reader.unexpectedElement();
}
} else if (tag == END_ELEMENT) {
return () -> {
Expand Down

0 comments on commit 9a42806

Please sign in to comment.