diff --git a/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java b/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java index 98db8e1..8fb3698 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java +++ b/src/main/java/org/htmlunit/cssparser/parser/CSSOMParser.java @@ -21,7 +21,20 @@ import java.util.Deque; import java.util.List; -import org.htmlunit.cssparser.dom.*; +import org.htmlunit.cssparser.dom.AbstractCSSRuleImpl; +import org.htmlunit.cssparser.dom.CSSCharsetRuleImpl; +import org.htmlunit.cssparser.dom.CSSFontFaceRuleImpl; +import org.htmlunit.cssparser.dom.CSSImportRuleImpl; +import org.htmlunit.cssparser.dom.CSSMediaRuleImpl; +import org.htmlunit.cssparser.dom.CSSPageRuleImpl; +import org.htmlunit.cssparser.dom.CSSRuleListImpl; +import org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl; +import org.htmlunit.cssparser.dom.CSSStyleRuleImpl; +import org.htmlunit.cssparser.dom.CSSStyleSheetImpl; +import org.htmlunit.cssparser.dom.CSSUnknownRuleImpl; +import org.htmlunit.cssparser.dom.CSSValueImpl; +import org.htmlunit.cssparser.dom.MediaListImpl; +import org.htmlunit.cssparser.dom.Property; import org.htmlunit.cssparser.parser.javacc.CSS3Parser; import org.htmlunit.cssparser.parser.media.MediaQueryList; import org.htmlunit.cssparser.parser.selector.SelectorList; @@ -100,7 +113,7 @@ public CSSStyleDeclarationImpl parseStyleDeclaration(final String styleDecl) thr * @throws IOException if the underlying SAC parser throws an IOException */ public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String styleDecl) throws IOException { - try (final InputSource source = new InputSource(new StringReader(styleDecl))) { + try (InputSource source = new InputSource(new StringReader(styleDecl))) { final Deque nodeStack = new ArrayDeque<>(); nodeStack.push(sd); final CSSOMHandler handler = new CSSOMHandler(nodeStack); @@ -117,7 +130,7 @@ public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String * @throws IOException if the underlying SAC parser throws an IOException */ public CSSValueImpl parsePropertyValue(final String propertyValue) throws IOException { - try (final InputSource source = new InputSource(new StringReader(propertyValue))) { + try (InputSource source = new InputSource(new StringReader(propertyValue))) { final CSSOMHandler handler = new CSSOMHandler(); parser_.setDocumentHandler(handler); final LexicalUnit lu = parser_.parsePropertyValue(source); @@ -136,7 +149,7 @@ public CSSValueImpl parsePropertyValue(final String propertyValue) throws IOExce * @throws IOException if the underlying SAC parser throws an IOException */ public AbstractCSSRuleImpl parseRule(final String rule) throws IOException { - try (final InputSource source = new InputSource(new StringReader(rule))) { + try (InputSource source = new InputSource(new StringReader(rule))) { final CSSOMHandler handler = new CSSOMHandler(); parser_.setDocumentHandler(handler); parser_.parseRule(source); @@ -152,7 +165,7 @@ public AbstractCSSRuleImpl parseRule(final String rule) throws IOException { * @throws IOException if the underlying SAC parser throws an IOException */ public SelectorList parseSelectors(final String selectors) throws IOException { - try (final InputSource source = new InputSource(new StringReader(selectors))) { + try (InputSource source = new InputSource(new StringReader(selectors))) { final HandlerBase handler = new HandlerBase(); parser_.setDocumentHandler(handler); return parser_.parseSelectors(source); @@ -167,7 +180,7 @@ public SelectorList parseSelectors(final String selectors) throws IOException { * @throws IOException if the underlying SAC parser throws an IOException */ public MediaQueryList parseMedia(final String media) throws IOException { - try (final InputSource source = new InputSource(new StringReader(media))) { + try (InputSource source = new InputSource(new StringReader(media))) { final HandlerBase handler = new HandlerBase(); parser_.setDocumentHandler(handler); return parser_.parseMedia(source); @@ -410,8 +423,8 @@ public void property(final String name, final LexicalUnit value, final boolean i private AbstractCSSRuleImpl getParentRule() { if (!nodeStack_.isEmpty() && nodeStack_.size() > 1) { - final List nodesStack_ = new ArrayList<>(nodeStack_); - final Object node = nodesStack_.get(nodesStack_.size() - 2); + final List nodesStack = new ArrayList<>(nodeStack_); + final Object node = nodesStack.get(nodesStack.size() - 2); if (node instanceof AbstractCSSRuleImpl) { return (AbstractCSSRuleImpl) node; } diff --git a/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java b/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java index e5163ae..b03c5c4 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java +++ b/src/main/java/org/htmlunit/cssparser/parser/condition/LangCondition.java @@ -71,4 +71,4 @@ public String toString() { result.append(")"); return result.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java b/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java index c847bec..f7fbe38 100644 --- a/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java +++ b/src/main/java/org/htmlunit/cssparser/parser/selector/ChildSelector.java @@ -69,4 +69,4 @@ public String toString() { return sb.toString(); } -} \ No newline at end of file +}