Skip to content

Commit

Permalink
Simplify condition for nested output/error elements
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Dec 21, 2023
1 parent 8676714 commit 065cf91
Showing 1 changed file with 4 additions and 6 deletions.
Expand Up @@ -432,7 +432,7 @@ private static void getTestProblems(
boolean trimStackTrace,
OutputStream fw,
String testErrorType,
boolean createOutErrElementsInside)
boolean enableNestedOutErrElements)
throws IOException {
ppw.startElement(testErrorType);

Expand All @@ -456,21 +456,19 @@ private static void getTestProblems(
}
}

boolean hasNestedElements = createOutErrElementsInside & stackTrace != null;

if (stackTrace != null) {
if (hasNestedElements) {
if (enableNestedOutErrElements) {
ppw.startElement("stackTrace");
}

extraEscapeElementValue(stackTrace, outputStreamWriter, ppw, fw);

if (hasNestedElements) {
if (enableNestedOutErrElements) {
ppw.endElement();
}
}

if (createOutErrElementsInside) {
if (enableNestedOutErrElements) {
createOutErrElements(outputStreamWriter, ppw, report, fw);
}

Expand Down

0 comments on commit 065cf91

Please sign in to comment.