You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stormcrawler.apache.org by rz...@apache.org on 2024/05/21 11:51:42 UTC
(incubator-stormcrawler) branch Avoid-use-of-star-imports-#1238 created (now 3518906e)
This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a change to branch Avoid-use-of-star-imports-#1238
in repository https://gitbox.apache.org/repos/asf/incubator-stormcrawler.git
at 3518906e Fix #1238 - Avoid use of star imports
This branch includes the following new commits:
new 3518906e Fix #1238 - Avoid use of star imports
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-stormcrawler) 01/01: Fix #1238 - Avoid use of star imports
Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch Avoid-use-of-star-imports-#1238
in repository https://gitbox.apache.org/repos/asf/incubator-stormcrawler.git
commit 3518906e3a8b7e497801540f65855d2201bcb9b5
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Tue May 21 13:51:36 2024 +0200
Fix #1238 - Avoid use of star imports
---
.../archetype-resources/src/main/java/CrawlTopology.java | 15 ++++++---------
.../apache/stormcrawler/persistence/DefaultScheduler.java | 9 ++++++++-
.../stormcrawler/protocol/httpclient/HttpProtocol.java | 2 +-
.../apache/stormcrawler/protocol/okhttp/HttpProtocol.java | 9 ++++++++-
.../java/org/apache/stormcrawler/spout/FileSpout.java | 6 +++++-
.../apache/stormcrawler/util/InitialisationUtilTest.java | 10 ++++++++--
.../java/org/apache/stormcrawler/tika/ParserBolt.java | 6 +++++-
.../java/org/apache/stormcrawler/urlfrontier/Spout.java | 9 ++++++++-
.../stormcrawler/urlfrontier/StatusUpdaterBolt.java | 11 ++++++++++-
9 files changed, 59 insertions(+), 18 deletions(-)
diff --git a/archetype/src/main/resources/archetype-resources/src/main/java/CrawlTopology.java b/archetype/src/main/resources/archetype-resources/src/main/java/CrawlTopology.java
index 4c354952..0fc247b5 100644
--- a/archetype/src/main/resources/archetype-resources/src/main/java/CrawlTopology.java
+++ b/archetype/src/main/resources/archetype-resources/src/main/java/CrawlTopology.java
@@ -14,23 +14,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package ${package};
+package $
-import org.apache.stormcrawler.*;
+import org.apache.storm.topology.TopologyBuilder;
+import org.apache.storm.tuple.Fields;
+import org.apache.stormcrawler.bolt.FeedParserBolt;
import org.apache.stormcrawler.bolt.FetcherBolt;
import org.apache.stormcrawler.bolt.JSoupParserBolt;
import org.apache.stormcrawler.bolt.SiteMapParserBolt;
import org.apache.stormcrawler.bolt.URLPartitionerBolt;
-import org.apache.stormcrawler.bolt.FeedParserBolt;
import org.apache.stormcrawler.indexing.StdOutIndexer;
-import org.apache.stormcrawler.persistence.StdOutStatusUpdater;
-import org.apache.stormcrawler.urlfrontier.Spout;
-import org.apache.stormcrawler.urlfrontier.StatusUpdaterBolt;
import org.apache.stormcrawler.tika.ParserBolt;
import org.apache.stormcrawler.tika.RedirectionBolt;
-
-import org.apache.storm.topology.TopologyBuilder;
-import org.apache.storm.tuple.Fields;
+import org.apache.stormcrawler.urlfrontier.Spout;
+import org.apache.stormcrawler.urlfrontier.StatusUpdaterBolt;
/**
* Dummy topology to play with the spouts and bolts
diff --git a/core/src/main/java/org/apache/stormcrawler/persistence/DefaultScheduler.java b/core/src/main/java/org/apache/stormcrawler/persistence/DefaultScheduler.java
index 925ea716..86ee0295 100644
--- a/core/src/main/java/org/apache/stormcrawler/persistence/DefaultScheduler.java
+++ b/core/src/main/java/org/apache/stormcrawler/persistence/DefaultScheduler.java
@@ -16,7 +16,14 @@
*/
package org.apache.stormcrawler.persistence;
-import java.util.*;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Optional;
+import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.stormcrawler.Constants;
diff --git a/core/src/main/java/org/apache/stormcrawler/protocol/httpclient/HttpProtocol.java b/core/src/main/java/org/apache/stormcrawler/protocol/httpclient/HttpProtocol.java
index 6478bb3c..9c2c019b 100644
--- a/core/src/main/java/org/apache/stormcrawler/protocol/httpclient/HttpProtocol.java
+++ b/core/src/main/java/org/apache/stormcrawler/protocol/httpclient/HttpProtocol.java
@@ -61,7 +61,7 @@ import org.apache.stormcrawler.protocol.AbstractHttpProtocol;
import org.apache.stormcrawler.protocol.HttpHeaders;
import org.apache.stormcrawler.protocol.Protocol;
import org.apache.stormcrawler.protocol.ProtocolResponse;
-import org.apache.stormcrawler.proxy.*;
+import org.apache.stormcrawler.proxy.SCProxy;
import org.apache.stormcrawler.util.ConfUtils;
import org.apache.stormcrawler.util.CookieConverter;
import org.jetbrains.annotations.Nullable;
diff --git a/core/src/main/java/org/apache/stormcrawler/protocol/okhttp/HttpProtocol.java b/core/src/main/java/org/apache/stormcrawler/protocol/okhttp/HttpProtocol.java
index 01902713..2aefa950 100644
--- a/core/src/main/java/org/apache/stormcrawler/protocol/okhttp/HttpProtocol.java
+++ b/core/src/main/java/org/apache/stormcrawler/protocol/okhttp/HttpProtocol.java
@@ -23,7 +23,14 @@ import java.net.Proxy;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.cert.CertificateException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
diff --git a/core/src/main/java/org/apache/stormcrawler/spout/FileSpout.java b/core/src/main/java/org/apache/stormcrawler/spout/FileSpout.java
index 773b90a2..0b24dfc1 100644
--- a/core/src/main/java/org/apache/stormcrawler/spout/FileSpout.java
+++ b/core/src/main/java/org/apache/stormcrawler/spout/FileSpout.java
@@ -26,7 +26,11 @@ import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.*;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
import org.apache.commons.lang.StringUtils;
import org.apache.storm.spout.Scheme;
import org.apache.storm.spout.SpoutOutputCollector;
diff --git a/core/src/test/java/org/apache/stormcrawler/util/InitialisationUtilTest.java b/core/src/test/java/org/apache/stormcrawler/util/InitialisationUtilTest.java
index da6d4ac9..e4341802 100644
--- a/core/src/test/java/org/apache/stormcrawler/util/InitialisationUtilTest.java
+++ b/core/src/test/java/org/apache/stormcrawler/util/InitialisationUtilTest.java
@@ -16,8 +16,14 @@
*/
package org.apache.stormcrawler.util;
-import org.apache.stormcrawler.helper.initialisation.*;
-import org.apache.stormcrawler.helper.initialisation.base.*;
+import org.apache.stormcrawler.helper.initialisation.ClassInheritingFromAbstractClassOnly;
+import org.apache.stormcrawler.helper.initialisation.ClassInheritingFromOpenClass;
+import org.apache.stormcrawler.helper.initialisation.ClassWithoutValidConstructor;
+import org.apache.stormcrawler.helper.initialisation.FinalClassToInitialize;
+import org.apache.stormcrawler.helper.initialisation.SimpleOpenClass;
+import org.apache.stormcrawler.helper.initialisation.base.AbstractClass;
+import org.apache.stormcrawler.helper.initialisation.base.ITestInterface;
+import org.apache.stormcrawler.helper.initialisation.base.OpenClassWithAbstractClassAndInterface;
import org.junit.Assert;
import org.junit.Test;
diff --git a/external/tika/src/main/java/org/apache/stormcrawler/tika/ParserBolt.java b/external/tika/src/main/java/org/apache/stormcrawler/tika/ParserBolt.java
index 77314050..1239679e 100644
--- a/external/tika/src/main/java/org/apache/stormcrawler/tika/ParserBolt.java
+++ b/external/tika/src/main/java/org/apache/stormcrawler/tika/ParserBolt.java
@@ -22,7 +22,11 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.html.dom.HTMLDocumentImpl;
import org.apache.storm.metric.api.MultiCountMetric;
diff --git a/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/Spout.java b/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/Spout.java
index b039dbae..c53afd6d 100644
--- a/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/Spout.java
+++ b/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/Spout.java
@@ -16,7 +16,14 @@
*/
package org.apache.stormcrawler.urlfrontier;
-import static org.apache.stormcrawler.urlfrontier.Constants.*;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_ADDRESS_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_DEFAULT_HOST;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_DEFAULT_PORT;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_DELAY_REQUESTABLE_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_HOST_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_MAX_BUCKETS_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_MAX_URLS_PER_BUCKET_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_PORT_KEY;
import crawlercommons.urlfrontier.URLFrontierGrpc;
import crawlercommons.urlfrontier.URLFrontierGrpc.URLFrontierStub;
diff --git a/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/StatusUpdaterBolt.java b/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/StatusUpdaterBolt.java
index 50e61508..ebe1ff66 100644
--- a/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/StatusUpdaterBolt.java
+++ b/external/urlfrontier/src/main/java/org/apache/stormcrawler/urlfrontier/StatusUpdaterBolt.java
@@ -16,7 +16,16 @@
*/
package org.apache.stormcrawler.urlfrontier;
-import static org.apache.stormcrawler.urlfrontier.Constants.*;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_ADDRESS_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_CACHE_EXPIREAFTER_SEC_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_CRAWL_ID_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_DEFAULT_HOST;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_DEFAULT_PORT;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_HOST_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_MAX_MESSAGES_IN_FLIGHT_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_PORT_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_THROTTLING_TIME_MS_KEY;
+import static org.apache.stormcrawler.urlfrontier.Constants.URLFRONTIER_UPDATER_MAX_MESSAGES_KEY;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;