Skip to content

Commit e3f97b4

Browse files
oswettorbri
authored andcommitted
Fixed Checkstyle errors
1 parent 47086fa commit e3f97b4

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@
2121
import java.util.Deque;
2222
import java.util.List;
2323

24-
import org.htmlunit.cssparser.dom.*;
24+
import org.htmlunit.cssparser.dom.AbstractCSSRuleImpl;
25+
import org.htmlunit.cssparser.dom.CSSCharsetRuleImpl;
26+
import org.htmlunit.cssparser.dom.CSSFontFaceRuleImpl;
27+
import org.htmlunit.cssparser.dom.CSSImportRuleImpl;
28+
import org.htmlunit.cssparser.dom.CSSMediaRuleImpl;
29+
import org.htmlunit.cssparser.dom.CSSPageRuleImpl;
30+
import org.htmlunit.cssparser.dom.CSSRuleListImpl;
31+
import org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl;
32+
import org.htmlunit.cssparser.dom.CSSStyleRuleImpl;
33+
import org.htmlunit.cssparser.dom.CSSStyleSheetImpl;
34+
import org.htmlunit.cssparser.dom.CSSUnknownRuleImpl;
35+
import org.htmlunit.cssparser.dom.CSSValueImpl;
36+
import org.htmlunit.cssparser.dom.MediaListImpl;
37+
import org.htmlunit.cssparser.dom.Property;
2538
import org.htmlunit.cssparser.parser.javacc.CSS3Parser;
2639
import org.htmlunit.cssparser.parser.media.MediaQueryList;
2740
import org.htmlunit.cssparser.parser.selector.SelectorList;
@@ -100,7 +113,7 @@ public CSSStyleDeclarationImpl parseStyleDeclaration(final String styleDecl) thr
100113
* @throws IOException if the underlying SAC parser throws an IOException
101114
*/
102115
public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String styleDecl) throws IOException {
103-
try (final InputSource source = new InputSource(new StringReader(styleDecl))) {
116+
try (InputSource source = new InputSource(new StringReader(styleDecl))) {
104117
final Deque<Object> nodeStack = new ArrayDeque<>();
105118
nodeStack.push(sd);
106119
final CSSOMHandler handler = new CSSOMHandler(nodeStack);
@@ -117,7 +130,7 @@ public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String
117130
* @throws IOException if the underlying SAC parser throws an IOException
118131
*/
119132
public CSSValueImpl parsePropertyValue(final String propertyValue) throws IOException {
120-
try (final InputSource source = new InputSource(new StringReader(propertyValue))) {
133+
try (InputSource source = new InputSource(new StringReader(propertyValue))) {
121134
final CSSOMHandler handler = new CSSOMHandler();
122135
parser_.setDocumentHandler(handler);
123136
final LexicalUnit lu = parser_.parsePropertyValue(source);
@@ -136,7 +149,7 @@ public CSSValueImpl parsePropertyValue(final String propertyValue) throws IOExce
136149
* @throws IOException if the underlying SAC parser throws an IOException
137150
*/
138151
public AbstractCSSRuleImpl parseRule(final String rule) throws IOException {
139-
try (final InputSource source = new InputSource(new StringReader(rule))) {
152+
try (InputSource source = new InputSource(new StringReader(rule))) {
140153
final CSSOMHandler handler = new CSSOMHandler();
141154
parser_.setDocumentHandler(handler);
142155
parser_.parseRule(source);
@@ -152,7 +165,7 @@ public AbstractCSSRuleImpl parseRule(final String rule) throws IOException {
152165
* @throws IOException if the underlying SAC parser throws an IOException
153166
*/
154167
public SelectorList parseSelectors(final String selectors) throws IOException {
155-
try (final InputSource source = new InputSource(new StringReader(selectors))) {
168+
try (InputSource source = new InputSource(new StringReader(selectors))) {
156169
final HandlerBase handler = new HandlerBase();
157170
parser_.setDocumentHandler(handler);
158171
return parser_.parseSelectors(source);
@@ -167,7 +180,7 @@ public SelectorList parseSelectors(final String selectors) throws IOException {
167180
* @throws IOException if the underlying SAC parser throws an IOException
168181
*/
169182
public MediaQueryList parseMedia(final String media) throws IOException {
170-
try (final InputSource source = new InputSource(new StringReader(media))) {
183+
try (InputSource source = new InputSource(new StringReader(media))) {
171184
final HandlerBase handler = new HandlerBase();
172185
parser_.setDocumentHandler(handler);
173186
return parser_.parseMedia(source);
@@ -410,8 +423,8 @@ public void property(final String name, final LexicalUnit value, final boolean i
410423

411424
private AbstractCSSRuleImpl getParentRule() {
412425
if (!nodeStack_.isEmpty() && nodeStack_.size() > 1) {
413-
final List<Object> nodesStack_ = new ArrayList<>(nodeStack_);
414-
final Object node = nodesStack_.get(nodesStack_.size() - 2);
426+
final List<Object> nodesStack = new ArrayList<>(nodeStack_);
427+
final Object node = nodesStack.get(nodesStack.size() - 2);
415428
if (node instanceof AbstractCSSRuleImpl) {
416429
return (AbstractCSSRuleImpl) node;
417430
}

src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ public String toString() {
7171
result.append(")");
7272
return result.toString();
7373
}
74-
}
74+
}

src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ public String toString() {
6969

7070
return sb.toString();
7171
}
72-
}
72+
}

0 commit comments

Comments
 (0)