Skip to content

Commit 698baf0

Browse files
committed
style: Update maven checkstyle plugin version
I upgraded the Eclipse checkstyle plugin (eclipse-cs), however, some parameter names changed. Updating the config to use the same name is straightforward, but now the maven plugin (which still uses the older version of checkstyle) causes the build to fail. This patch changes the parent POM to track the same version of checkstyle that the Eclipse plugin uses. That allows me to use the same config for both. This patch also fixes some style violations -- otherwise, the build would fail. ;)
1 parent e3e3efe commit 698baf0

File tree

6 files changed

+43
-28
lines changed

6 files changed

+43
-28
lines changed

config/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Checkstyle configuration that checks the Google coding conventions from Google J
191191
</module>
192192
<module name="JavadocMethod">
193193
<property name="allowedAnnotations" value="Override, Test"/>
194-
<property name="scope" value="public"/>
194+
<property name="accessModifiers" value="public"/>
195195
<property name="allowMissingParamTags" value="true"/>
196196
<property name="allowMissingReturnTag" value="true"/>
197197
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>

module/jsonurl-core/src/main/java/org/jsonurl/stream/AbstractCharIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public AbstractCharIterator(String name) {
8989
* Create a new AbstractCharIterator.
9090
* @param name Resource {@link Resource#getName() name}
9191
* @param limit maximum number of parsed characters before a
92-
* {@link org.jsonurl.LimitException LimitException} is thrown.
92+
* {@link org.jsonurl.LimitException LimitException} is thrown.
9393
*/
9494
public AbstractCharIterator(String name, long limit) {
9595
this.name = name;

module/jsonurl-core/src/main/java/org/jsonurl/stream/JsonUrlCharSequence.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public JsonUrlCharSequence(String name, CharSequence text) {
8080
* @param name the resource {@link Resource#getName() name}
8181
* @param text a valid CharSequence
8282
* @param limit maximum number of parsed characters before a
83-
* {@link org.jsonurl.LimitException LimitException} is thrown.
83+
* {@link org.jsonurl.LimitException LimitException} is thrown.
8484
*/
8585
public JsonUrlCharSequence(String name, CharSequence text, long limit) {
8686
this(name, text, 0, text.length(), limit);
@@ -93,7 +93,7 @@ public JsonUrlCharSequence(String name, CharSequence text, long limit) {
9393
* @param offset starting offset
9494
* @param length stop when this length is reached
9595
* @param limit maximum number of parsed characters before a
96-
* {@link org.jsonurl.LimitException LimitException} is thrown.
96+
* {@link org.jsonurl.LimitException LimitException} is thrown.
9797
*/
9898
public JsonUrlCharSequence(
9999
String name,

module/jsonurl-core/src/test/java/org/jsonurl/text/JsonUrlStringBuilderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,10 @@ void testText6() throws IOException {
530530
@ParameterizedTest
531531
@Tag("exception")
532532
@ValueSource(strings = {
533-
Character.MIN_LOW_SURROGATE + "" + Character.MIN_HIGH_SURROGATE, // NOPMD
534-
Character.MIN_HIGH_SURROGATE + "", // NOPMD
535-
Character.MIN_HIGH_SURROGATE + "" + Character.MIN_HIGH_SURROGATE, // NOPMD
536-
Character.MAX_HIGH_SURROGATE + "" + (Character.MAX_LOW_SURROGATE + 1), // NOPMD
533+
Character.MIN_LOW_SURROGATE + "" + Character.MIN_HIGH_SURROGATE, // NOPMD
534+
Character.MIN_HIGH_SURROGATE + "", // NOPMD
535+
Character.MIN_HIGH_SURROGATE + "" + Character.MIN_HIGH_SURROGATE, // NOPMD
536+
Character.MAX_HIGH_SURROGATE + "" + (Character.MAX_LOW_SURROGATE + 1), // NOPMD
537537
})
538538
void testExceptionUtf8(String text) throws IOException {
539539
assertThrows(

module/jsonurl-factory/src/test/java/org/jsonurl/factory/AbstractParseTest.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ void testExceptionComposite(String text) {
208208

209209
@ParameterizedTest
210210
@ValueSource(strings = {
211-
"(1)",
212-
"(a(",
213-
"(a:",
214-
"(a:b(",
215-
"(a:b,a",
216-
"(a:b,c&)",
211+
"(1)",
212+
"(a(",
213+
"(a:",
214+
"(a:b(",
215+
"(a:b,a",
216+
"(a:b,c&)",
217217
})
218218
void testExceptionObject(String text) {
219219
assertThrows(
@@ -228,8 +228,8 @@ void testExceptionObject(String text) {
228228

229229
@ParameterizedTest
230230
@ValueSource(strings = {
231-
"(a:b)",
232-
"(a(",
231+
"(a:b)",
232+
"(a(",
233233
})
234234
void testExceptionArray(String text) {
235235
assertThrows(
@@ -802,10 +802,10 @@ void testStringsWithStructCharsQuotedAndEncoded(String text)
802802

803803
@ParameterizedTest
804804
@ValueSource(strings = {
805-
HELLO,
806-
"t", "tr", "tru", "True", "tRue", "trUe", "truE",
807-
"f", "fa", "fal", "fals", "False", "fAlse", "faLse", "falSe", "falsE",
808-
"n", "nu", "nul", "Null", "nUll", "nuLl", "nulL",
805+
HELLO,
806+
"t", "tr", "tru", "True", "tRue", "trUe", "truE",
807+
"f", "fa", "fal", "fals", "False", "fAlse", "faLse", "falSe", "falsE",
808+
"n", "nu", "nul", "Null", "nUll", "nuLl", "nulL",
809809
})
810810
void testString(String text) throws IOException {
811811
assertParse(text, getFactoryString(text));
@@ -865,13 +865,13 @@ void testUtf8(String text, String expected) throws IOException {
865865
// https://www.piday.org/million/
866866
//
867867
"3.14159265358979323846264338327950288419716939937510582097494459230781"
868-
+ "64062862089986280348253421170679821480865132823066470938446095505822"
869-
+ "31725359408128481117450284102701938521105559644622948954930381964428"
870-
+ "81097566593344612847564823378678316527120190914564856692346034861045"
871-
+ "43266482133936072602491412737245870066063155881748815209209628292540"
872-
+ "91715364367892590360011330530548820466521384146951941511609433057270"
873-
+ "36575959195309218611738193261179310511854807446237996274956735188575"
874-
+ "2724891227938183011949"
868+
+ "64062862089986280348253421170679821480865132823066470938446095505822"
869+
+ "31725359408128481117450284102701938521105559644622948954930381964428"
870+
+ "81097566593344612847564823378678316527120190914564856692346034861045"
871+
+ "43266482133936072602491412737245870066063155881748815209209628292540"
872+
+ "91715364367892590360011330530548820466521384146951941511609433057270"
873+
+ "36575959195309218611738193261179310511854807446237996274956735188575"
874+
+ "2724891227938183011949"
875875
})
876876
void testMathContext(String text) throws IOException {
877877
if (factory instanceof BigMathProvider) {

module/pom.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<maven.surefire.plugin>2.22.2</maven.surefire.plugin>
4949
<maven.surefire.report.plugin>2.22.2</maven.surefire.report.plugin>
5050
<maven.javadoc.plugin>3.2.0</maven.javadoc.plugin>
51-
<maven.checkstyle.plugin>3.1.1</maven.checkstyle.plugin>
51+
<maven.checkstyle.plugin>3.1.2</maven.checkstyle.plugin>
5252
<maven.pmd.plugin>3.13.0</maven.pmd.plugin>
5353
<maven.jacoco.plugin>0.8.5</maven.jacoco.plugin>
5454
<maven.gpg.plugin>1.6</maven.gpg.plugin>
@@ -60,6 +60,14 @@
6060
<nexus.staging.plugin>1.6.8</nexus.staging.plugin>
6161
<codehaus.versions.plugin>2.7</codehaus.versions.plugin>
6262
<sonar.maven.plugin>3.7.0.1746</sonar.maven.plugin>
63+
64+
<!--
65+
This should track the version used by the Eclipse CHeckstyle Plugin
66+
https://checkstyle.org/eclipse-cs/
67+
68+
Doing so allows both to share the same config file.
69+
-->
70+
<checkstyle.version>8.43</checkstyle.version>
6371

6472
<nexus.url>https://oss.sonatype.org</nexus.url>
6573

@@ -200,6 +208,13 @@
200208
<linkXRef>false</linkXRef>
201209
<includeTestSourceDirectory>true</includeTestSourceDirectory>
202210
</configuration>
211+
<dependencies>
212+
<dependency>
213+
<groupId>com.puppycrawl.tools</groupId>
214+
<artifactId>checkstyle</artifactId>
215+
<version>${checkstyle.version}</version>
216+
</dependency>
217+
</dependencies>
203218
</plugin>
204219
<plugin>
205220
<artifactId>maven-pmd-plugin</artifactId>

0 commit comments

Comments
 (0)