Apache Nutch is an extensible and scalable web crawler
NUTCH-3216 Fix remaining codespell findings flagged by Yetus on master (#978)
Lewis John McGibbneyf1610723f016
diff --git a/.codespellrc b/.codespellrcindex 9c76c2d71..59200d840 100644--- a/.codespellrc+++ b/.codespellrc@@ -4,9 +4,11 @@# used to exercise SpellCheckedMetadata error-tolerant Location header matching.# uery: intentional query-string token in urlnormalizer-protocol TestProtocolURLNormalizer.# fo: intentional trie matcher test prefix in PrefixStringMatcher/SuffixStringMatcher demo mains.-ignore-words-list = AfterAll,BeforeAll,Loction,uery,fo+# atLeast: Mockito verifier (org.mockito.Mockito.atLeast), not the phrase "at least".+ignore-words-list = AfterAll,BeforeAll,Loction,uery,fo,atLeast# CHANGES.md is a historical changelog not maintained by this branch.# Language-identifier corpora, binary license trees, and naivebayes training# sample are also listed in .yetus/excludes.txt for full-tree Yetus runs; skip-# them here so local codespell matches CI.-skip = CHANGES.md,src/plugin/language-identifier/src/test,LICENSE-binary,NOTICE-binary,licenses-binary,conf/naivebayes-train.txt.template,src/plugin/language-identifier/src/java/org/apache/nutch/analysis/lang/langmappings.properties,**/naivebayes-model,**/sample/**+# them here so local codespell matches CI. Path globs must match the ./ prefix+# that codespell produces when Yetus runs "codespell .".+skip = CHANGES.md,*src/plugin/language-identifier/src/test,LICENSE-binary,NOTICE-binary,licenses-binary,*conf/naivebayes-train.txt.template,*src/plugin/language-identifier/src/java/org/apache/nutch/analysis/lang/langmappings.properties,**/naivebayes-model,**/sample/**diff --git a/src/test/org/apache/nutch/metadata/TestMetadata.java b/src/test/org/apache/nutch/metadata/TestMetadata.javaindex f73fd6cb9..4c314916d 100644--- a/src/test/org/apache/nutch/metadata/TestMetadata.java+++ b/src/test/org/apache/nutch/metadata/TestMetadata.java@@ -267,16 +267,16 @@ public class TestMetadata {}private Metadata writeRead(Metadata meta) {- Metadata readed = new Metadata();+ Metadata readBack = new Metadata();try {ByteArrayOutputStream out = new ByteArrayOutputStream();meta.write(new DataOutputStream(out));- readed.readFields(new DataInputStream(new ByteArrayInputStream(out+ readBack.readFields(new DataInputStream(new ByteArrayInputStream(out.toByteArray())));} catch (IOException ioe) {fail(ioe.toString());}- return readed;+ return readBack;}}diff --git a/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java b/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.javaindex c36f02139..62469e00e 100644--- a/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java+++ b/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java@@ -355,16 +355,16 @@ public class TestSpellCheckedMetadata {}private SpellCheckedMetadata writeRead(SpellCheckedMetadata meta) {- SpellCheckedMetadata readed = new SpellCheckedMetadata();+ SpellCheckedMetadata readBack = new SpellCheckedMetadata();try {ByteArrayOutputStream out = new ByteArrayOutputStream();meta.write(new DataOutputStream(out));- readed.readFields(new DataInputStream(new ByteArrayInputStream(out+ readBack.readFields(new DataInputStream(new ByteArrayInputStream(out.toByteArray())));} catch (IOException ioe) {fail(ioe.toString());}- return readed;+ return readBack;}/**diff --git a/src/test/org/apache/nutch/parse/parse-plugin-test.xml b/src/test/org/apache/nutch/parse/parse-plugin-test.xmlindex 2eeb48391..1e3d34c38 100644--- a/src/test/org/apache/nutch/parse/parse-plugin-test.xml+++ b/src/test/org/apache/nutch/parse/parse-plugin-test.xml@@ -30,7 +30,7 @@<!-- test these 4 plugins --><mimeType name="text/html"><!--- ! Test that if a parser cannot be instanciated,+ ! Test that if a parser cannot be instantiated,! it should not block the process and then the next one is used!--><plugin id="parse-plugin-that-not-exist"/>diff --git a/src/test/org/apache/nutch/util/TestGZIPUtils.java b/src/test/org/apache/nutch/util/TestGZIPUtils.javaindex 129f7deec..592f2899f 100644--- a/src/test/org/apache/nutch/util/TestGZIPUtils.java+++ b/src/test/org/apache/nutch/util/TestGZIPUtils.java@@ -28,10 +28,10 @@ import static org.junit.jupiter.api.Assertions.fail;/** Unit tests for GZIPUtils methods. */public class TestGZIPUtils {- /* a short, highly compressable, string */+ /* a short, highly compressible, string */String SHORT_TEST_STRING = "aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbcccccccccccccccc";- /* a short, highly compressable, string */+ /* a short, highly compressible, string */String LONGER_TEST_STRING = SHORT_TEST_STRING + SHORT_TEST_STRING+ SHORT_TEST_STRING + SHORT_TEST_STRING + SHORT_TEST_STRING+ SHORT_TEST_STRING + SHORT_TEST_STRING + SHORT_TEST_STRINGdiff --git a/src/test/org/apache/nutch/util/TestURLUtil.java b/src/test/org/apache/nutch/util/TestURLUtil.javaindex 7c7267ce8..e2fbc5c50 100644--- a/src/test/org/apache/nutch/util/TestURLUtil.java+++ b/src/test/org/apache/nutch/util/TestURLUtil.java@@ -139,10 +139,12 @@ public class TestURLUtil {url = new URL("http://subdomain.example.edu.tr");assertEquals("edu.tr", URLUtil.getDomainSuffix(url));- url = new URL("http://subdomain.example.presse.fr");+ url = new URL(+ "http://subdomain.example.presse.fr"); // codespell:ignore presseassertEquals("fr", URLUtil.getDomainSuffix(url));- url = new URL("http://subdomain.example.presse.tr");+ url = new URL(+ "http://subdomain.example.presse.tr"); // codespell:ignore presseassertEquals("tr", URLUtil.getDomainSuffix(url));// plc.co.im is listed as a domain suffixdiff --git a/src/testresources/fetch-test-site/pageb.html b/src/testresources/fetch-test-site/pageb.htmlindex cf77ff4f7..d9018be55 100644--- a/src/testresources/fetch-test-site/pageb.html+++ b/src/testresources/fetch-test-site/pageb.html@@ -16,7 +16,7 @@--><html><head>- <title>bage b</title>+ <title>page b</title></head><body>This is page b