Skip to content

Commit

Permalink
Merge pull request #291 from barspi/master
Browse files Browse the repository at this point in the history
Avoid long-lived reference to DOM Element within lambda closure
  • Loading branch information
ar authored Nov 20, 2023
2 parents b8728ad + bb2e99e commit 3e8ebd7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ public String select(long id, Serializable context) {
public void setConfiguration(Element e) throws ConfigurationException {
try {
for (Element r : e.getChildren("route")) {
String name = r.getAttributeValue("name");
routes.computeIfAbsent(
r.getAttributeValue("method"),
k -> new ArrayList<>()).add(
new Route<>(
r.getAttributeValue("path"),
r.getAttributeValue("method"),
(t, s) -> r.getAttributeValue("name"))
(t, s) -> name)
);
}
} catch (Throwable t) {
Expand Down

0 comments on commit 3e8ebd7

Please sign in to comment.