From 7d54e188ad81807b15176de980000f75fc2af2b1 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Wed, 4 Jan 2023 02:37:53 +0100 Subject: [PATCH] Optimize imports (by IntelliJ): - Drop unused imports (!) - Re-order imports alphabetically - Resolve star imports --- .../groovy/org/aim42/filesystem/FileCollector.groovy | 2 -- .../org/aim42/htmlsanitycheck/AllChecksRunner.groovy | 12 ++++-------- .../org/aim42/htmlsanitycheck/Configuration.groovy | 2 +- .../htmlsanitycheck/HtmlSanityCheckPlugin.groovy | 3 +-- .../htmlsanitycheck/check/CheckerCreator.groovy | 1 - .../check/MissingImageFilesChecker.groovy | 4 ++-- .../check/MissingLocalResourcesChecker.groovy | 4 ++-- .../org/aim42/htmlsanitycheck/html/HtmlPage.groovy | 4 ++-- .../htmlsanitycheck/report/LoggerReporter.groovy | 3 --- .../aim42/htmlsanitycheck/suggest/Suggester.groovy | 12 ++++-------- .../similarity/StringSimilarityServiceImpl.java | 2 +- .../java/org/aim42/net/TrustAllCertificates.java | 7 ++++++- .../aim42/htmlsanitycheck/AllChecksRunnerTest.groovy | 1 - .../HtmlSanityCheckTaskFunctionalTest.groovy | 1 - .../check/BrokenHttpLinksCheckerSpec.groovy | 3 +-- .../htmlsanitycheck/check/CheckerCreatorSpec.groovy | 1 - .../report/JUnitXmlReporterTest.groovy | 2 -- .../suggest/StringSimilarityServiceImplTest.java | 6 +++++- src/test/java/org/aim42/UnsecureHttpConnection.java | 1 - 19 files changed, 29 insertions(+), 42 deletions(-) diff --git a/src/main/groovy/org/aim42/filesystem/FileCollector.groovy b/src/main/groovy/org/aim42/filesystem/FileCollector.groovy index 359c2964..c5edeb15 100644 --- a/src/main/groovy/org/aim42/filesystem/FileCollector.groovy +++ b/src/main/groovy/org/aim42/filesystem/FileCollector.groovy @@ -2,8 +2,6 @@ package org.aim42.filesystem import groovy.io.FileType -import java.util.regex.Pattern - // see end-of-file for license information // TODO: add exclude-patterns diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/AllChecksRunner.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/AllChecksRunner.groovy index 82753416..f39ef4ca 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/AllChecksRunner.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/AllChecksRunner.groovy @@ -1,16 +1,12 @@ package org.aim42.htmlsanitycheck -import org.aim42.filesystem.FileCollector -import org.aim42.filesystem.FileUtil -import org.aim42.htmlsanitycheck.check.* + +import org.aim42.htmlsanitycheck.check.Checker +import org.aim42.htmlsanitycheck.check.CheckerCreator import org.aim42.htmlsanitycheck.collect.PerRunResults import org.aim42.htmlsanitycheck.collect.SinglePageResults import org.aim42.htmlsanitycheck.html.HtmlPage -import org.aim42.htmlsanitycheck.report.ConsoleReporter -import org.aim42.htmlsanitycheck.report.HtmlReporter -import org.aim42.htmlsanitycheck.report.JUnitXmlReporter -import org.aim42.htmlsanitycheck.report.LoggerReporter -import org.aim42.htmlsanitycheck.report.Reporter +import org.aim42.htmlsanitycheck.report.* import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/Configuration.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/Configuration.groovy index b033e048..1ec7c303 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/Configuration.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/Configuration.groovy @@ -1,6 +1,6 @@ package org.aim42.htmlsanitycheck -import org.aim42.filesystem.FileCollector + import org.aim42.htmlsanitycheck.check.AllCheckers import org.aim42.inet.NetUtil diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckPlugin.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckPlugin.groovy index fd519bc5..79f3c546 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckPlugin.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckPlugin.groovy @@ -2,10 +2,9 @@ package org.aim42.htmlsanitycheck +import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.language.base.plugins.LifecycleBasePlugin -import org.gradle.api.Plugin - class HtmlSanityCheckPlugin implements Plugin { diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/check/CheckerCreator.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/check/CheckerCreator.groovy index a17b7860..e5d7fc93 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/check/CheckerCreator.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/check/CheckerCreator.groovy @@ -1,7 +1,6 @@ package org.aim42.htmlsanitycheck.check import org.aim42.htmlsanitycheck.Configuration -import org.aim42.htmlsanitycheck.check.UnknownCheckerException import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.groovy index ba69ba3e..46d23487 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingImageFilesChecker.groovy @@ -1,10 +1,10 @@ package org.aim42.htmlsanitycheck.check import org.aim42.htmlsanitycheck.Configuration -import org.aim42.htmlsanitycheck.html.HtmlPage -import org.aim42.htmlsanitycheck.html.URLUtil import org.aim42.htmlsanitycheck.collect.SingleCheckResults import org.aim42.htmlsanitycheck.html.HtmlElement +import org.aim42.htmlsanitycheck.html.HtmlPage +import org.aim42.htmlsanitycheck.html.URLUtil import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingLocalResourcesChecker.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingLocalResourcesChecker.groovy index 743c1238..f3988b8b 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingLocalResourcesChecker.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/check/MissingLocalResourcesChecker.groovy @@ -1,9 +1,9 @@ package org.aim42.htmlsanitycheck.check -import org.aim42.htmlsanitycheck.html.HtmlPage -import org.aim42.htmlsanitycheck.html.URLUtil import org.aim42.htmlsanitycheck.Configuration import org.aim42.htmlsanitycheck.collect.SingleCheckResults +import org.aim42.htmlsanitycheck.html.HtmlPage +import org.aim42.htmlsanitycheck.html.URLUtil import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/html/HtmlPage.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/html/HtmlPage.groovy index 8ed9a94f..d00d13a8 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/html/HtmlPage.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/html/HtmlPage.groovy @@ -1,12 +1,12 @@ package org.aim42.htmlsanitycheck.html import groovy.transform.Memoized - -import java.util.regex.Pattern import org.jsoup.Jsoup import org.jsoup.nodes.Document import org.jsoup.select.Elements +import java.util.regex.Pattern + // see end-of-file for license information /** diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/report/LoggerReporter.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/report/LoggerReporter.groovy index f65ff7ef..692fc957 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/report/LoggerReporter.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/report/LoggerReporter.groovy @@ -1,10 +1,7 @@ package org.aim42.htmlsanitycheck.report import groovy.transform.InheritConstructors -import org.aim42.htmlsanitycheck.ProductVersion import org.aim42.htmlsanitycheck.collect.PerRunResults -import org.aim42.htmlsanitycheck.collect.SingleCheckResults -import org.aim42.htmlsanitycheck.collect.SinglePageResults import org.slf4j.Logger /************************************************************************ diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/suggest/Suggester.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/suggest/Suggester.groovy index 03cd2edc..10ca9534 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/suggest/Suggester.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/suggest/Suggester.groovy @@ -1,12 +1,8 @@ -package org.aim42.htmlsanitycheck.suggest; +package org.aim42.htmlsanitycheck.suggest -import net.ricecode.similarity.JaroWinklerStrategy; -import net.ricecode.similarity.SimilarityStrategy; -import net.ricecode.similarity.StringSimilarityService; -import net.ricecode.similarity.StringSimilarityServiceImpl; - -import java.util.ArrayList; -import java.util.List; +import net.ricecode.similarity.JaroWinklerStrategy +import net.ricecode.similarity.StringSimilarityService +import net.ricecode.similarity.StringSimilarityServiceImpl /** * Finds suggestions for a target within a given list of options by applying string-similarity search diff --git a/src/main/java/net/ricecode/similarity/StringSimilarityServiceImpl.java b/src/main/java/net/ricecode/similarity/StringSimilarityServiceImpl.java index 7e6f1bd3..08d0ee0e 100644 --- a/src/main/java/net/ricecode/similarity/StringSimilarityServiceImpl.java +++ b/src/main/java/net/ricecode/similarity/StringSimilarityServiceImpl.java @@ -24,9 +24,9 @@ package net.ricecode.similarity; import java.util.ArrayList; +import java.util.Collections; import java.util.Comparator; import java.util.List; -import java.util.Collections; /** diff --git a/src/main/java/org/aim42/net/TrustAllCertificates.java b/src/main/java/org/aim42/net/TrustAllCertificates.java index 21a48c1e..24ed8f79 100644 --- a/src/main/java/org/aim42/net/TrustAllCertificates.java +++ b/src/main/java/org/aim42/net/TrustAllCertificates.java @@ -2,7 +2,12 @@ // created by https://www.geekality.net/2013/09/27/java-ignore-ssl-certificate-errors/ -import javax.net.ssl.*; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.cert.X509Certificate; diff --git a/src/test/groovy/org/aim42/htmlsanitycheck/AllChecksRunnerTest.groovy b/src/test/groovy/org/aim42/htmlsanitycheck/AllChecksRunnerTest.groovy index 4c88b595..1e8da9dc 100644 --- a/src/test/groovy/org/aim42/htmlsanitycheck/AllChecksRunnerTest.groovy +++ b/src/test/groovy/org/aim42/htmlsanitycheck/AllChecksRunnerTest.groovy @@ -2,7 +2,6 @@ package org.aim42.htmlsanitycheck import org.aim42.htmlsanitycheck.check.AllCheckers import org.aim42.htmlsanitycheck.collect.SinglePageResults -import org.junit.Before import org.junit.Test class AllChecksRunnerTest extends GroovyTestCase { diff --git a/src/test/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckTaskFunctionalTest.groovy b/src/test/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckTaskFunctionalTest.groovy index ece54bf5..e15aef48 100644 --- a/src/test/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckTaskFunctionalTest.groovy +++ b/src/test/groovy/org/aim42/htmlsanitycheck/HtmlSanityCheckTaskFunctionalTest.groovy @@ -3,7 +3,6 @@ package org.aim42.htmlsanitycheck import org.gradle.testkit.runner.GradleRunner import org.jsoup.Jsoup import org.jsoup.nodes.Element -import org.jsoup.select.Elements import org.junit.Rule import org.junit.rules.TemporaryFolder import spock.lang.Specification diff --git a/src/test/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksCheckerSpec.groovy b/src/test/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksCheckerSpec.groovy index 76ff7912..f73be638 100644 --- a/src/test/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksCheckerSpec.groovy +++ b/src/test/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksCheckerSpec.groovy @@ -5,12 +5,11 @@ import org.aim42.htmlsanitycheck.collect.SingleCheckResults import org.aim42.htmlsanitycheck.html.HtmlConst import org.aim42.htmlsanitycheck.html.HtmlPage import org.aim42.inet.NetUtil -import spock.lang.IgnoreIf import spock.lang.Ignore +import spock.lang.IgnoreIf import spock.lang.Specification import spock.lang.Unroll - // see end-of-file for license information diff --git a/src/test/groovy/org/aim42/htmlsanitycheck/check/CheckerCreatorSpec.groovy b/src/test/groovy/org/aim42/htmlsanitycheck/check/CheckerCreatorSpec.groovy index 0ab0c5af..b2230efa 100644 --- a/src/test/groovy/org/aim42/htmlsanitycheck/check/CheckerCreatorSpec.groovy +++ b/src/test/groovy/org/aim42/htmlsanitycheck/check/CheckerCreatorSpec.groovy @@ -3,7 +3,6 @@ package org.aim42.htmlsanitycheck.check import org.aim42.htmlsanitycheck.Configuration import org.aim42.htmlsanitycheck.html.HtmlPage import spock.lang.Specification -import sun.security.krb5.Config /** * specifiy behavior of CheckerCreator factory diff --git a/src/test/groovy/org/aim42/htmlsanitycheck/report/JUnitXmlReporterTest.groovy b/src/test/groovy/org/aim42/htmlsanitycheck/report/JUnitXmlReporterTest.groovy index 32ec2e87..e4cf2a82 100644 --- a/src/test/groovy/org/aim42/htmlsanitycheck/report/JUnitXmlReporterTest.groovy +++ b/src/test/groovy/org/aim42/htmlsanitycheck/report/JUnitXmlReporterTest.groovy @@ -6,9 +6,7 @@ import org.aim42.htmlsanitycheck.collect.SingleCheckResults import org.aim42.htmlsanitycheck.collect.SinglePageResults import org.junit.After import org.junit.Before -import org.junit.Rule import org.junit.Test -import org.junit.rules.TemporaryFolder // see end-of-file for license information diff --git a/src/test/groovy/org/aim42/htmlsanitycheck/suggest/StringSimilarityServiceImplTest.java b/src/test/groovy/org/aim42/htmlsanitycheck/suggest/StringSimilarityServiceImplTest.java index 80f36d51..dc722375 100644 --- a/src/test/groovy/org/aim42/htmlsanitycheck/suggest/StringSimilarityServiceImplTest.java +++ b/src/test/groovy/org/aim42/htmlsanitycheck/suggest/StringSimilarityServiceImplTest.java @@ -26,7 +26,11 @@ package org.aim42.htmlsanitycheck.suggest; -import net.ricecode.similarity.*; +import net.ricecode.similarity.JaroWinklerStrategy; +import net.ricecode.similarity.SimilarityScore; +import net.ricecode.similarity.SimilarityStrategy; +import net.ricecode.similarity.StringSimilarityService; +import net.ricecode.similarity.StringSimilarityServiceImpl; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/aim42/UnsecureHttpConnection.java b/src/test/java/org/aim42/UnsecureHttpConnection.java index 585fcf90..c82be19c 100644 --- a/src/test/java/org/aim42/UnsecureHttpConnection.java +++ b/src/test/java/org/aim42/UnsecureHttpConnection.java @@ -2,7 +2,6 @@ import javax.net.ssl.HttpsURLConnection; -import java.net.HttpURLConnection; import java.net.URL; public class UnsecureHttpConnection {