You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by ma...@apache.org on 2023/01/06 12:22:24 UTC
[opennlp] branch main updated: OPENNLP-1367 Update checkstyle rules for a recent checkstyle version (#483)
This is an automated email from the ASF dual-hosted git repository.
mawiesne pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp.git
The following commit(s) were added to refs/heads/main by this push:
new 8c789590 OPENNLP-1367 Update checkstyle rules for a recent checkstyle version (#483)
8c789590 is described below
commit 8c789590c3cf12416549ccc3beffafedf09289c8
Author: Martin Wiesner <ma...@users.noreply.github.com>
AuthorDate: Fri Jan 6 13:22:19 2023 +0100
OPENNLP-1367 Update checkstyle rules for a recent checkstyle version (#483)
- updates maven-checkstyle plugin to the latest version 3.2.0 (from outdated 2.17)
- updates checkstyle from ancient version 7.2 to most recent version 10.6
- adjusts configuration `checkstyle.xml` to match the requirements of checkstyle 10.x
- adjusts some code fragments that caused complaints by checkstyle 10.x
- fixed previously undetected violations, such as wrong indentations or missing whitespaces, now being detected
---
checkstyle.xml | 23 ++++++++++-----
.../java/opennlp/bratann/NameFinderAnnService.java | 1 -
.../java/opennlp/bratann/NameFinderResource.java | 1 -
.../dl/doccat/DocumentCategorizerDLEval.java | 1 -
.../opennlp/dl/namefinder/NameFinderDLEval.java | 1 -
.../tagdict/MorfologikTagDictionaryTest.java | 1 -
.../serializer/DictionaryEntryPersistor.java | 1 -
.../frenchtreebank/ConstitParseSampleStream.java | 1 -
.../IrishSentenceBankDocument.java | 4 +--
.../tools/formats/letsmt/LetsmtDocument.java | 1 -
.../opennlp/tools/formats/masc/MascDocument.java | 1 -
.../tools/formats/masc/MascDocumentStream.java | 1 -
.../tools/formats/nkjp/NKJPTextDocument.java | 1 -
.../tools/ml/model/ModelParameterChunker.java | 2 +-
.../opennlp/tools/ml/model/OnePassDataIndexer.java | 2 +-
.../namefind/DefaultNameContextGenerator.java | 2 +-
.../opennlp/tools/sentdetect/SentenceDetector.java | 34 +++++++++++-----------
.../src/main/java/opennlp/tools/util/Version.java | 2 +-
.../tools/util/featuregen/GeneratorFactory.java | 1 -
.../featuregen/TokenPatternFeatureGenerator.java | 2 +-
.../tokenizer/TokenizerTrainerToolTest.java | 1 -
.../opennlp/tools/eval/Conll02NameFinderEval.java | 1 -
.../tools/eval/OntoNotes4PosTaggerEval.java | 1 -
.../LanguageDetectorCrossValidatorTest.java | 1 -
.../opennlp/tools/util/MockInputStreamFactory.java | 1 -
.../src/main/java/opennlp/uima/util/UimaUtil.java | 2 +-
.../opennlp/uima/AnnotatorsInitializationTest.java | 1 -
.../uima/dictionary/DictionaryResourceTest.java | 1 -
.../uima/util/AnnotationComboIteratorTest.java | 1 -
.../src/test/java/opennlp/uima/util/CasUtil.java | 2 --
pom.xml | 7 ++---
31 files changed, 43 insertions(+), 59 deletions(-)
diff --git a/checkstyle.xml b/checkstyle.xml
index 0f705ec5..5a573b1c 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -29,8 +29,15 @@
<property name="fileExtensions" value="java, properties, xml"/>
- <module name="SuppressionCommentFilter"/>
-
+ <!--
+ Special exclusion for source files in snowball package which have a special copyright situation.
+ Background: Comment-based filtering changed in checkstyle 8+.
+ Therefore, the exclusion must be handled explicitly, otherwise the 'RegexpHeader' check would fail.
+ -->
+ <module name="BeforeExecutionExclusionFileFilter">
+ <property name="fileNamePattern" value=".*[\\/]src[\\/]main[\\/]java[\\/]opennlp[\\/]tools[\\/]stemmer[\\/]snowball.*$"/>
+ </module>
+
<module name="RegexpHeader">
<property name="header"
value="^.*$\n^\W*Licensed to the Apache Software Foundation \(ASF\) under one or more$"/>
@@ -42,6 +49,11 @@
<property name="eachLine" value="true"/>
</module>
+ <module name="LineLength">
+ <property name="max" value="110"/>
+ <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+ </module>
+
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
@@ -52,17 +64,13 @@
</module>
<module name="TreeWalker">
- <module name="FileContentsHolder"/>
+ <module name="SuppressionCommentFilter"/>
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
- <module name="LineLength">
- <property name="max" value="110"/>
- <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
- </module>
<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
<module name="OneTopLevelClass"/>
@@ -123,6 +131,7 @@
<module name="CustomImportOrder">
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
+ <property name="standardPackageRegExp" value="^(java|javax)\."/>
<property name="specialImportsRegExp" value="opennlp\."/>
<property name="customImportOrderRules"
value="STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STATIC"/>
diff --git a/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java b/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
index a6085e71..80a8265b 100644
--- a/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
+++ b/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
@@ -21,7 +21,6 @@ import java.io.File;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
-
import javax.ws.rs.core.UriBuilder;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
diff --git a/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderResource.java b/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderResource.java
index 9036e47b..0adbabb1 100644
--- a/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderResource.java
+++ b/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderResource.java
@@ -21,7 +21,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
diff --git a/opennlp-dl/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java b/opennlp-dl/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
index 7977004c..2da7cad1 100644
--- a/opennlp-dl/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
+++ b/opennlp-dl/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
@@ -26,7 +26,6 @@ import java.util.Map;
import java.util.Set;
import ai.onnxruntime.OrtException;
-
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
diff --git a/opennlp-dl/src/test/java/opennlp/dl/namefinder/NameFinderDLEval.java b/opennlp-dl/src/test/java/opennlp/dl/namefinder/NameFinderDLEval.java
index 14e4c67b..155a7d2c 100644
--- a/opennlp-dl/src/test/java/opennlp/dl/namefinder/NameFinderDLEval.java
+++ b/opennlp-dl/src/test/java/opennlp/dl/namefinder/NameFinderDLEval.java
@@ -23,7 +23,6 @@ import java.util.HashMap;
import java.util.Map;
import ai.onnxruntime.OrtException;
-
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/opennlp-morfologik-addon/src/test/java/opennlp/morfologik/tagdict/MorfologikTagDictionaryTest.java b/opennlp-morfologik-addon/src/test/java/opennlp/morfologik/tagdict/MorfologikTagDictionaryTest.java
index 48d7ef5e..876a0a40 100644
--- a/opennlp-morfologik-addon/src/test/java/opennlp/morfologik/tagdict/MorfologikTagDictionaryTest.java
+++ b/opennlp-morfologik-addon/src/test/java/opennlp/morfologik/tagdict/MorfologikTagDictionaryTest.java
@@ -22,7 +22,6 @@ import java.util.Arrays;
import java.util.List;
import morfologik.stemming.Dictionary;
-
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionaryEntryPersistor.java b/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionaryEntryPersistor.java
index 90ba6665..5bf3fff2 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionaryEntryPersistor.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionaryEntryPersistor.java
@@ -24,7 +24,6 @@ import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStream.java
index fef25d8b..2de83407 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStream.java
@@ -21,7 +21,6 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-
import javax.xml.parsers.SAXParser;
import org.xml.sax.SAXException;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/irishsentencebank/IrishSentenceBankDocument.java b/opennlp-tools/src/main/java/opennlp/tools/formats/irishsentencebank/IrishSentenceBankDocument.java
index 1949eaa7..8777fa13 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/irishsentencebank/IrishSentenceBankDocument.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/irishsentencebank/IrishSentenceBankDocument.java
@@ -20,7 +20,6 @@ package opennlp.tools.formats.irishsentencebank;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.StringBuilder;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
@@ -28,7 +27,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
@@ -198,7 +196,7 @@ public class IrishSentenceBankDocument {
List<Span> spans = new ArrayList<>();
NodeList sentnl = sentnode.getChildNodes();
int flexes = 1;
- StringBuilder orig = new StringBuilder();
+ java.lang.StringBuilder orig = new java.lang.StringBuilder();
for (int j = 0; j < sentnl.getLength(); j++) {
final String name = sentnl.item(j).getNodeName();
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/letsmt/LetsmtDocument.java b/opennlp-tools/src/main/java/opennlp/tools/formats/letsmt/LetsmtDocument.java
index b1abd517..60b6bfc0 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/letsmt/LetsmtDocument.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/letsmt/LetsmtDocument.java
@@ -25,7 +25,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-
import javax.xml.parsers.SAXParser;
import org.xml.sax.InputSource;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocument.java b/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocument.java
index 01bea73f..5ea11ff9 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocument.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocument.java
@@ -31,7 +31,6 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-
import javax.xml.parsers.SAXParser;
import org.xml.sax.SAXException;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocumentStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocumentStream.java
index 96ec80d3..1fedb795 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocumentStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/masc/MascDocumentStream.java
@@ -29,7 +29,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Stack;
-
import javax.xml.parsers.SAXParser;
import org.xml.sax.Attributes;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/nkjp/NKJPTextDocument.java b/opennlp-tools/src/main/java/opennlp/tools/formats/nkjp/NKJPTextDocument.java
index 1ed187d7..a28aaf0e 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/nkjp/NKJPTextDocument.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/nkjp/NKJPTextDocument.java
@@ -24,7 +24,6 @@ import java.io.InputStream;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-
import javax.xml.parsers.DocumentBuilder;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/model/ModelParameterChunker.java b/opennlp-tools/src/main/java/opennlp/tools/ml/model/ModelParameterChunker.java
index 7e77c707..98d74be1 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/model/ModelParameterChunker.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/model/ModelParameterChunker.java
@@ -71,7 +71,7 @@ public final class ModelParameterChunker {
private static final int MAX_CHUNK_SIZE_BYTES = 65535; // the maximum 'utflen' DataOutputStream can handle
- private ModelParameterChunker(){
+ private ModelParameterChunker() {
// private utility class ct s
}
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/model/OnePassDataIndexer.java b/opennlp-tools/src/main/java/opennlp/tools/ml/model/OnePassDataIndexer.java
index 61d101ad..08119a4e 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/model/OnePassDataIndexer.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/model/OnePassDataIndexer.java
@@ -36,7 +36,7 @@ import opennlp.tools.util.ObjectStreamUtils;
*/
public class OnePassDataIndexer extends AbstractDataIndexer {
- public OnePassDataIndexer(){}
+ public OnePassDataIndexer() {}
/**
* {@inheritDoc}
diff --git a/opennlp-tools/src/main/java/opennlp/tools/namefind/DefaultNameContextGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/namefind/DefaultNameContextGenerator.java
index e591c0bf..1c43d148 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/namefind/DefaultNameContextGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/namefind/DefaultNameContextGenerator.java
@@ -72,7 +72,7 @@ public class DefaultNameContextGenerator implements NameContextGenerator {
}
else { // use defaults
this.featureGenerators =
- new AdaptiveFeatureGenerator[]{WINDOW_FEATURES, new PreviousMapFeatureGenerator()};
+ new AdaptiveFeatureGenerator[]{WINDOW_FEATURES, new PreviousMapFeatureGenerator()};
}
}
diff --git a/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetector.java b/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetector.java
index 58c66fb4..2e7fd22c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetector.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetector.java
@@ -26,22 +26,22 @@ import opennlp.tools.util.Span;
*/
public interface SentenceDetector {
- /**
- * Detects sentences in a character sequence.
- *
- * @param s The {@link CharSequence} for which sentences shall to be detected.
- * @return The String[] with the individual sentences as the array
- * elements.
- */
- String[] sentDetect(CharSequence s);
+ /**
+ * Detects sentences in a character sequence.
+ *
+ * @param s The {@link CharSequence} for which sentences shall to be detected.
+ * @return The String[] with the individual sentences as the array
+ * elements.
+ */
+ String[] sentDetect(CharSequence s);
- /**
- * Detects sentences in a character sequence.
- *
- * @param s The {@link CharSequence} for which sentences shall be detected.
- *
- * @return The array of {@link Span spans} (offsets into {@code s}) for each
- * detected sentence as the individuals array elements.
- */
- Span[] sentPosDetect(CharSequence s);
+ /**
+ * Detects sentences in a character sequence.
+ *
+ * @param s The {@link CharSequence} for which sentences shall be detected.
+ *
+ * @return The array of {@link Span spans} (offsets into {@code s}) for each
+ * detected sentence as the individuals array elements.
+ */
+ Span[] sentPosDetect(CharSequence s);
}
diff --git a/opennlp-tools/src/main/java/opennlp/tools/util/Version.java b/opennlp-tools/src/main/java/opennlp/tools/util/Version.java
index 1b7895b1..87f62ce9 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/util/Version.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/util/Version.java
@@ -75,7 +75,7 @@ public class Version {
* @param revision Must not be negative.
*/
public Version(int major, int minor, int revision) {
- this(major, minor, revision, false);
+ this(major, minor, revision, false);
}
/**
diff --git a/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/GeneratorFactory.java b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/GeneratorFactory.java
index fa030a31..e4d18fb8 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/GeneratorFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/GeneratorFactory.java
@@ -26,7 +26,6 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-
import javax.xml.parsers.DocumentBuilder;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenPatternFeatureGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenPatternFeatureGenerator.java
index 9fc9ddd4..99adfc98 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenPatternFeatureGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenPatternFeatureGenerator.java
@@ -39,7 +39,7 @@ public class TokenPatternFeatureGenerator implements AdaptiveFeatureGenerator {
* For tokenization the {@link SimpleTokenizer} is used.
*/
public TokenPatternFeatureGenerator() {
- this(SimpleTokenizer.INSTANCE);
+ this(SimpleTokenizer.INSTANCE);
}
/**
diff --git a/opennlp-tools/src/test/java/opennlp/tools/cmdline/tokenizer/TokenizerTrainerToolTest.java b/opennlp-tools/src/test/java/opennlp/tools/cmdline/tokenizer/TokenizerTrainerToolTest.java
index 9a5f1138..36b796dc 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/cmdline/tokenizer/TokenizerTrainerToolTest.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/cmdline/tokenizer/TokenizerTrainerToolTest.java
@@ -25,7 +25,6 @@ import java.io.InputStream;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
-
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
diff --git a/opennlp-tools/src/test/java/opennlp/tools/eval/Conll02NameFinderEval.java b/opennlp-tools/src/test/java/opennlp/tools/eval/Conll02NameFinderEval.java
index bccf729c..9a171256 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/eval/Conll02NameFinderEval.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/eval/Conll02NameFinderEval.java
@@ -19,7 +19,6 @@ package opennlp.tools.eval;
import java.io.File;
import java.io.IOException;
-
import java.math.BigInteger;
import org.junit.jupiter.api.Assertions;
diff --git a/opennlp-tools/src/test/java/opennlp/tools/eval/OntoNotes4PosTaggerEval.java b/opennlp-tools/src/test/java/opennlp/tools/eval/OntoNotes4PosTaggerEval.java
index d3c4c8a5..252080d3 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/eval/OntoNotes4PosTaggerEval.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/eval/OntoNotes4PosTaggerEval.java
@@ -20,7 +20,6 @@ package opennlp.tools.eval;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
-
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Assertions;
diff --git a/opennlp-tools/src/test/java/opennlp/tools/langdetect/LanguageDetectorCrossValidatorTest.java b/opennlp-tools/src/test/java/opennlp/tools/langdetect/LanguageDetectorCrossValidatorTest.java
index 6e85e65a..47382cb2 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/langdetect/LanguageDetectorCrossValidatorTest.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/langdetect/LanguageDetectorCrossValidatorTest.java
@@ -19,7 +19,6 @@ package opennlp.tools.langdetect;
import java.util.concurrent.atomic.AtomicInteger;
-
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/opennlp-tools/src/test/java/opennlp/tools/util/MockInputStreamFactory.java b/opennlp-tools/src/test/java/opennlp/tools/util/MockInputStreamFactory.java
index 7390d257..79aedc3e 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/util/MockInputStreamFactory.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/util/MockInputStreamFactory.java
@@ -20,7 +20,6 @@ package opennlp.tools.util;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
-
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
diff --git a/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java b/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java
index c428037f..863fed9e 100644
--- a/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java
+++ b/opennlp-uima/src/main/java/opennlp/uima/util/UimaUtil.java
@@ -31,7 +31,7 @@ import org.apache.uima.cas.text.AnnotationFS;
*/
public final class UimaUtil {
- private UimaUtil(){
+ private UimaUtil() {
// this is util class must not be instantiated
}
diff --git a/opennlp-uima/src/test/java/opennlp/uima/AnnotatorsInitializationTest.java b/opennlp-uima/src/test/java/opennlp/uima/AnnotatorsInitializationTest.java
index 2b460bf9..44519d2c 100644
--- a/opennlp-uima/src/test/java/opennlp/uima/AnnotatorsInitializationTest.java
+++ b/opennlp-uima/src/test/java/opennlp/uima/AnnotatorsInitializationTest.java
@@ -27,7 +27,6 @@ import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
import org.junit.jupiter.api.Assertions;
/**
diff --git a/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java b/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
index 1eaa9167..8b44b4b1 100644
--- a/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
+++ b/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
@@ -33,7 +33,6 @@ import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
diff --git a/opennlp-uima/src/test/java/opennlp/uima/util/AnnotationComboIteratorTest.java b/opennlp-uima/src/test/java/opennlp/uima/util/AnnotationComboIteratorTest.java
index d5c63caf..b107673f 100644
--- a/opennlp-uima/src/test/java/opennlp/uima/util/AnnotationComboIteratorTest.java
+++ b/opennlp-uima/src/test/java/opennlp/uima/util/AnnotationComboIteratorTest.java
@@ -26,7 +26,6 @@ import java.util.List;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.text.AnnotationFS;
import org.apache.uima.resource.metadata.TypeSystemDescription;
-
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/opennlp-uima/src/test/java/opennlp/uima/util/CasUtil.java b/opennlp-uima/src/test/java/opennlp/uima/util/CasUtil.java
index 1a455805..0fb5a7b5 100644
--- a/opennlp-uima/src/test/java/opennlp/uima/util/CasUtil.java
+++ b/opennlp-uima/src/test/java/opennlp/uima/util/CasUtil.java
@@ -20,7 +20,6 @@ package opennlp.uima.util;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
@@ -38,7 +37,6 @@ import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
import org.apache.uima.util.XMLParser;
-
import org.xml.sax.SAXException;
public class CasUtil {
diff --git a/pom.xml b/pom.xml
index 84fb8287..406e9569 100644
--- a/pom.xml
+++ b/pom.xml
@@ -159,7 +159,7 @@
<junit.version>5.9.1</junit.version>
<morfologik.version>2.1.7</morfologik.version>
<osgi.version>4.2.0</osgi.version>
- <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
+ <checkstyle.plugin.version>3.2.0</checkstyle.plugin.version>
<onnxruntime.version>1.10.0</onnxruntime.version>
<opennlp.forkCount>1.0C</opennlp.forkCount>
<coveralls.maven.plugin>4.3.0</coveralls.maven.plugin>
@@ -203,7 +203,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
- <version>7.2</version>
+ <version>10.6.0</version>
</dependency>
</dependencies>
<executions>
@@ -212,10 +212,9 @@
<phase>validate</phase>
<configuration>
<configLocation>checkstyle.xml</configLocation>
- <encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
- <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
+ <testSourceDirectories>${project.basedir}/src/test/java</testSourceDirectories>
<violationSeverity>error</violationSeverity>
<failOnViolation>true</failOnViolation>
</configuration>