Skip to content

Commit 497c21e

Browse files
committed
checkstyle update
1 parent bf17f58 commit 497c21e

File tree

14 files changed

+41
-34
lines changed

14 files changed

+41
-34
lines changed

checkstyle.xml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
<?xml version="1.0"?>
21
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
2+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
3+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
54

65
<module name="Checker">
76

@@ -25,13 +24,17 @@
2524
<module name="Translation"/>
2625

2726
<module name="Header">
28-
* Copyright (c) 2019-2020 Ronald Brill.\n *\n * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"/>
27+
<property name="header" value="/*\n * Copyright (c) 2019-2020 Ronald Brill.\n *\n * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"/>
2928
</module>
3029

3130
<module name="FileTabCharacter">
3231
<property name="eachLine" value="true"/>
3332
</module>
3433

34+
<module name="LineLength">
35+
<property name="max" value="120"/>
36+
</module>
37+
3538
<!-- Prevent two spaces after @xxxx -->
3639
<module name="RegexpSingleline">
3740
<property name="format" value="\* *@\w* "/>
@@ -120,10 +123,6 @@
120123
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
121124
</module>
122125

123-
<module name="LineLength">
124-
<property name="max" value="120"/>
125-
</module>
126-
127126
<module name="ConstantName">
128127
<property name="format" value="log|^[a-zA-Z][a-zA-Z0-9_]*$"/>
129128
</module>
@@ -132,8 +131,6 @@
132131
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
133132
<module name="JavadocMethod">
134133
<property name="scope" value="protected"/>
135-
<property name="logLoadErrors" value="true"/>
136-
<property name="suppressLoadErrors" value="true"/>
137134
</module>
138135
<module name="JavadocType">
139136
<property name="scope" value="protected"/>
@@ -220,11 +217,19 @@
220217
<module name="InnerAssignment"/>
221218
<module name="MissingSwitchDefault"/>
222219
<module name="EqualsAvoidNull"/>
220+
<module name="MultipleVariableDeclarations"/>
223221

224222
<module name="SimplifyBooleanReturn"/>
225223
<module name="SimplifyBooleanExpression"/>
226224

227225
<module name="UnnecessaryParentheses"/>
226+
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
227+
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
228+
<module name="UnnecessarySemicolonInEnumeration"/>
229+
<module name="UnnecessarySemicolonInTryWithResources"/>
230+
231+
<!-- module name="ParameterAssignment"/-->
232+
<module name="SuperFinalize"/>
228233

229234
<!-- Checks for class design -->
230235
<!-- See http://checkstyle.sf.net/config_design.html -->
@@ -241,6 +246,9 @@
241246

242247
<module name="FinalLocalVariable">
243248
<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
249+
<property name="validateEnhancedForLoopVariable" value="true"/>
244250
</module>
251+
<module name="HiddenField"/>
252+
<module name="MissingOverride"/>
245253
</module>
246254
</module>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>net.sourceforge.htmlunit</groupId>
66
<artifactId>htmlunit-cssparser</artifactId>
7-
<version>1.7.0</version>
7+
<version>1.8.0-SNAPSHOT</version>
88
<name>HtmlUnit CSS Parser</name>
99
<packaging>jar</packaging>
1010
<description>CSS parser for HtmlUnit.</description>
@@ -112,7 +112,7 @@
112112
<dependency>
113113
<groupId>com.puppycrawl.tools</groupId>
114114
<artifactId>checkstyle</artifactId>
115-
<version>8.36.1</version>
115+
<version>8.37</version>
116116
</dependency>
117117
</dependencies>
118118
</plugin>

src/main/java/com/gargoylesoftware/css/dom/CSSRuleListImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void delete(final int index) {
7878
@Override
7979
public String toString() {
8080
final StringBuilder sb = new StringBuilder();
81-
for (AbstractCSSRuleImpl rule : rules_) {
81+
for (final AbstractCSSRuleImpl rule : rules_) {
8282
if (sb.length() > 0) {
8383
sb.append("\r\n");
8484
}
@@ -104,7 +104,7 @@ private boolean equalsRules(final CSSRuleListImpl crl) {
104104
return false;
105105
}
106106
int i = 0;
107-
for (AbstractCSSRuleImpl rule : rules_) {
107+
for (final AbstractCSSRuleImpl rule : rules_) {
108108
final AbstractCSSRuleImpl cssRule2 = crl.rules_.get(i);
109109
if (!LangUtils.equals(rule, cssRule2)) {
110110
return false;

src/main/java/com/gargoylesoftware/css/dom/CSSStyleDeclarationImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private boolean equalsProperties(final CSSStyleDeclarationImpl csd) {
247247
if ((csd == null) || (getLength() != csd.getLength())) {
248248
return false;
249249
}
250-
for (Property property : properties_) {
250+
for (final Property property : properties_) {
251251
final String propertyName = property.getName();
252252
// CSSValue propertyCSSValue1 = getPropertyCSSValue(propertyName);
253253
// CSSValue propertyCSSValue2 = csd.getPropertyCSSValue(propertyName);

src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public void addOtherSelector(final Selector s, final CSSStyleRuleImpl styleRule)
474474
*/
475475
public CSSStyleSheetRuleIndex addMedia(final MediaListImpl mediaList) {
476476
final String media = mediaList.getMediaText();
477-
for (CSSStyleSheetRuleIndex cssStyleSheetRuleIndex : children_) {
477+
for (final CSSStyleSheetRuleIndex cssStyleSheetRuleIndex : children_) {
478478
if (media.equals(cssStyleSheetRuleIndex.getMediaList().getMediaText())) {
479479
return cssStyleSheetRuleIndex;
480480
}
@@ -531,7 +531,7 @@ static final class SelectorEntriesIterator implements Iterator<SelectorEntry> {
531531
}
532532

533533
if (classes != null) {
534-
for (String clazz : classes) {
534+
for (final String clazz : classes) {
535535
selectors = index.classSelectors_.get("." + clazz);
536536
if (selectors != null && !selectors.isEmpty()) {
537537
iterators_.add(selectors.iterator());

src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetListImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private boolean equalsStyleSheets(final CSSStyleSheetListImpl ssl) {
9292
return false;
9393
}
9494
int i = 0;
95-
for (CSSStyleSheetImpl styleSheet : cssStyleSheets_) {
95+
for (final CSSStyleSheetImpl styleSheet : cssStyleSheets_) {
9696
final CSSStyleSheetImpl styleSheet2 = ssl.cssStyleSheets_.get(i);
9797
if (!LangUtils.equals(styleSheet, styleSheet2)) {
9898
return false;

src/main/java/com/gargoylesoftware/css/dom/CSSValueImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public enum CSSValueType {
4848
CSS_INHERIT,
4949

5050
/** CSS_PRIMITIVE_VALUE. */
51-
CSS_PRIMITIVE_VALUE;
51+
CSS_PRIMITIVE_VALUE
5252
}
5353

5454
/**

src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public MediaListImpl(final MediaQueryList mediaList) {
5757
public String getMediaText() {
5858
final StringBuilder sb = new StringBuilder("");
5959
boolean isNotFirst = false;
60-
for (MediaQuery mediaQuery : mediaQueries_) {
60+
for (final MediaQuery mediaQuery : mediaQueries_) {
6161
if (isNotFirst) {
6262
sb.append(", ");
6363
}
@@ -118,7 +118,7 @@ public String toString() {
118118
*/
119119
public void setMedia(final List<String> media) {
120120
mediaQueries_.clear();
121-
for (String medium : media) {
121+
for (final String medium : media) {
122122
mediaQueries_.add(new MediaQuery(medium));
123123
}
124124
}
@@ -135,7 +135,7 @@ private boolean equalsMedia(final MediaListImpl ml) {
135135
}
136136

137137
int i = 0;
138-
for (MediaQuery mediaQuery : mediaQueries_) {
138+
for (final MediaQuery mediaQuery : mediaQueries_) {
139139
final String m1 = mediaQuery.getMedia();
140140
final String m2 = ml.mediaQuery(i).getMedia();
141141
if (!LangUtils.equals(m1, m2)) {

src/main/java/com/gargoylesoftware/css/parser/media/MediaQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public String toString() {
101101

102102
sb.append(getMedia());
103103

104-
for (Property prop : properties_) {
104+
for (final Property prop : properties_) {
105105
sb.append(" and (")
106106
.append(prop.toString())
107107
.append(')');

src/main/java/com/gargoylesoftware/css/parser/media/MediaQueryList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void add(final MediaQuery mediaQuery) {
6060
@Override
6161
public String toString() {
6262
final StringBuilder sb = new StringBuilder();
63-
for (MediaQuery mediaQuery : mediaQueries_) {
63+
for (final MediaQuery mediaQuery : mediaQueries_) {
6464
if (sb.length() > 0) {
6565
sb.append(", ");
6666
}

0 commit comments

Comments
 (0)