From b46d478d59c279e20362ccdcb49c331830da1e78 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Mon, 16 Sep 2024 09:42:50 +0200 Subject: [PATCH] #343 Mark some Sonar issues and suppress warnings for the time being --- .../htmlsanitycheck/check/BrokenCrossReferencesChecker.java | 2 +- .../aim42/htmlsanitycheck/check/MissingImageFilesChecker.java | 2 +- .../org/aim42/htmlsanitycheck/report/JUnitXmlReporter.java | 4 ++-- .../src/main/java/org/aim42/net/TrustAllCertificates.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/BrokenCrossReferencesChecker.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/BrokenCrossReferencesChecker.java index d6dcbbc0..37e98ccd 100644 --- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/BrokenCrossReferencesChecker.java +++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/BrokenCrossReferencesChecker.java @@ -101,7 +101,7 @@ private void doesLinkTargetExist(String href) { try { linkTarget = URLDecoder.decode(linkTarget, "UTF-8"); } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); + throw new RuntimeException(e); //NOSONAR(S112) } if (!listOfIds.contains(linkTarget)) { diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.java index 900db39d..a3940468 100644 --- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.java +++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.java @@ -96,7 +96,7 @@ private void doesImageFileExist(String relativePathToImageFile) { try { decodedRelativePathtoImageFile = URLDecoder.decode(relativePathToImageFile,"UTF-8"); } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); + throw new RuntimeException(e); //NOSONAR(S112) } File imageFile = new File(parentDir, decodedRelativePathtoImageFile); diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/JUnitXmlReporter.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/JUnitXmlReporter.java index 2da21b3a..523f4e61 100644 --- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/JUnitXmlReporter.java +++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/JUnitXmlReporter.java @@ -48,7 +48,7 @@ public JUnitXmlReporter(PerRunResults runResults, String outputPath) { @Override protected void initReport() { if (!outputPath.canWrite() && !outputPath.mkdirs()) { - throw new RuntimeException("Cannot create or write to " + outputPath); + throw new RuntimeException("Cannot create or write to " + outputPath); //NOSONAR(S112) } } @@ -92,7 +92,7 @@ protected void reportPageSummary(SinglePageResults singlePageResults) { writer.flush(); } catch (IOException | XMLStreamException e) { - throw new RuntimeException(e); + throw new RuntimeException(e); //NOSONAR(S112) } } diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/net/TrustAllCertificates.java b/htmlSanityCheck-core/src/main/java/org/aim42/net/TrustAllCertificates.java index af878613..fa4c94b1 100644 --- a/htmlSanityCheck-core/src/main/java/org/aim42/net/TrustAllCertificates.java +++ b/htmlSanityCheck-core/src/main/java/org/aim42/net/TrustAllCertificates.java @@ -41,7 +41,7 @@ public static void install() { } catch (NoSuchAlgorithmException | KeyManagementException e) { - throw new RuntimeException("Failed setting up all thrusting certificate manager.", e); //NOSONAR(S112) + throw new RuntimeException("Failed to set up all thrusting certificate managers.", e); //NOSONAR(S112) } }