Skip to content

Commit

Permalink
#340 don't re-assign local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Jul 19, 2024
1 parent 20e3f87 commit 600b3ea
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,11 @@ private void traverseOptions(Element e, String prefix) {
traverseOptions(child, prefix + child.getAttribute("label")
+ " ");
} else if (child.getNodeName().equalsIgnoreCase("option")) {
String value = child.getAttribute("value");
String label = child.getAttribute("label");
String valueAttribute = child.getAttribute("value");
String labelAttribute = child.getAttribute("label");
String content = collectText(child);
if (value.isEmpty()) {
value = content;
}
if (label.isEmpty()) {
label = content;
} else {
label = prefix + label;
}
String value = valueAttribute.isEmpty() ? content : valueAttribute;
String label = labelAttribute.isEmpty() ? content : prefix + labelAttribute;
_options.put(value, label);
if (!child.getAttribute("selected").isEmpty()) {
if (isMultiple()) {
Expand Down

0 comments on commit 600b3ea

Please sign in to comment.