Skip to content

Commit

Permalink
yet more style adjustments to try to make CI happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Ciavarella committed Jan 2, 2022
1 parent c028328 commit 88528f0
Showing 1 changed file with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import edu.hm.hafner.analysis.Report;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.Nullable;

import se.bjurr.violations.lib.model.Violation;
import se.bjurr.violations.lib.parsers.ValgrindParser;
Expand Down Expand Up @@ -62,7 +61,7 @@ private String generateDescriptionHtml(final Violation violation) {
return description.toString();
}

private void appendGeneralTable(final StringBuilder html, final String executable, final String uniqueId, @Nullable final String threadId, @Nullable final String threadName, @Nullable final JSONArray auxWhats) {
private void appendGeneralTable(final StringBuilder html, final String executable, final String uniqueId, @CheckForNull final String threadId, @CheckForNull final String threadName, @CheckForNull final JSONArray auxWhats) {
html.append("<table>");

maybeAppendTableRow(html, "Executable", executable);
Expand All @@ -79,33 +78,35 @@ private void appendGeneralTable(final StringBuilder html, final String executabl
html.append("</table>");
}

private void maybeAppendStackTraces(final StringBuilder html, @Nullable final String stacksJson, final String message, @Nullable final JSONArray auxWhats) {
if (stacksJson != null && !stacksJson.isEmpty()) {
final JSONArray stacks = new JSONArray(new JSONTokener(stacksJson));
private void maybeAppendStackTraces(final StringBuilder html, @CheckForNull final String stacksJson, final String message, @CheckForNull final JSONArray auxWhats) {
if (stacksJson == null || stacksJson.isEmpty()) {
return;
}

if (!stacks.isEmpty()) {
appendStackTrace(html, "Primary Stack Trace", message, stacks.getJSONArray(0));
final JSONArray stacks = new JSONArray(new JSONTokener(stacksJson));

for (int stackIndex = 1; stackIndex < stacks.length(); ++stackIndex) {
String msg = null;
if (!stacks.isEmpty()) {
appendStackTrace(html, "Primary Stack Trace", message, stacks.getJSONArray(0));

if (auxWhats != null && auxWhats.length() >= stackIndex) {
msg = auxWhats.getString(stackIndex - 1);
}
for (int stackIndex = 1; stackIndex < stacks.length(); ++stackIndex) {
String msg = null;

String title = "Auxiliary Stack Trace";
if (auxWhats != null && auxWhats.length() >= stackIndex) {
msg = auxWhats.getString(stackIndex - 1);
}

if (stacks.length() > NUMBERED_STACK_THRESHOLD) {
title = "Auxiliary Stack Trace #" + stackIndex;
}
String title = "Auxiliary Stack Trace";

appendStackTrace(html, title, msg, stacks.getJSONArray(stackIndex));
if (stacks.length() > NUMBERED_STACK_THRESHOLD) {
title = "Auxiliary Stack Trace #" + stackIndex;
}

appendStackTrace(html, title, msg, stacks.getJSONArray(stackIndex));
}
}
}

private void appendStackTrace(final StringBuilder html, final String title, @Nullable final String message, final JSONArray frames) {
private void appendStackTrace(final StringBuilder html, final String title, @CheckForNull final String message, final JSONArray frames) {
html
.append("<h2>")
.append(title)
Expand Down Expand Up @@ -137,7 +138,7 @@ private void appendStackFrame(final StringBuilder html, final JSONObject frame)
html.append("</table>");
}

private void maybeAppendSuppression(final StringBuilder html, @Nullable final String suppression) {
private void maybeAppendSuppression(final StringBuilder html, @CheckForNull final String suppression) {
if (suppression != null && !suppression.isEmpty()) {
html
.append("<h2>Suppression</h2><table><tr><td class=\"pane\"><pre>")
Expand All @@ -146,7 +147,7 @@ private void maybeAppendSuppression(final StringBuilder html, @Nullable final St
}
}

private void maybeAppendTableRow(final StringBuilder html, final String name, @Nullable final String value) {
private void maybeAppendTableRow(final StringBuilder html, final String name, @CheckForNull final String value) {
if (value != null && !value.isEmpty()) {
html
.append("<tr><td class=\"pane-header\">")
Expand Down

0 comments on commit 88528f0

Please sign in to comment.