Skip to content

Commit 3069757

Browse files
committed
fix: PMD
1 parent 6e30952 commit 3069757

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

plugin/src/main/java/io/snyk/eclipse/plugin/html/BaseHtmlProvider.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class BaseHtmlProvider {
2323
private final Random random = new Random();
2424
private final Map<String, String> colorCache = new HashMap<>();
2525
private String nonce = "";
26-
private byte ASCII_RANGE = 0x7F;
2726
public String getCss() {
2827
return "";
2928
}
@@ -208,10 +207,8 @@ public ITheme getCurrentTheme() {
208207
return currentTheme;
209208
}
210209
public String getErrorHtml(String errorMessage, String path) {
211-
if (errorMessage == null) errorMessage = "Unknown error";
212-
if (path == null) path = "Unknown path";
213-
String escapedErrorMessage = StringEscapeUtils.escapeHtml3((errorMessage));
214-
String escapedPath = StringEscapeUtils.escapeHtml3(path);
210+
String escapedErrorMessage = errorMessage == null ? "Unknown error" : StringEscapeUtils.escapeHtml3((errorMessage));
211+
String escapedPath = path == null ? "Unknown path" : StringEscapeUtils.escapeHtml3(path);
215212
var html = String.format("""
216213
<!DOCTYPE html>
217214
<html lang="en">

0 commit comments

Comments
 (0)