Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/document-cleanup' into document-…
Browse files Browse the repository at this point in the history
…cleanup
  • Loading branch information
Josh-Matsuoka committed May 15, 2024
2 parents d102e9d + 3d87129 commit fcf0e94
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public Optional<String> getXml(String templateName, TemplateType type)
return Optional.empty();
}
try {
Optional<Document> document =
conn.getService().getServerTemplates().stream()
return conn.getService().getServerTemplates().stream()
.map(xmlText -> Jsoup.parse(xmlText, "", Parser.xmlParser()))
.filter(
doc -> {
Expand All @@ -85,12 +84,8 @@ public Optional<String> getXml(String templateName, TemplateType type)
}
return configuration.attr("label").equals(templateName);
})
.map(doc -> document.toString())
.findFirst();
if (document.isPresent()) {
return Optional.of(document.get().toString());
} else {
return Optional.empty();
}
} catch (org.openjdk.jmc.flightrecorder.configuration.FlightRecorderException
| IOException
| ServiceNotAvailableException e) {
Expand Down

0 comments on commit fcf0e94

Please sign in to comment.