2121import java .util .Deque ;
2222import 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 ;
2538import org .htmlunit .cssparser .parser .javacc .CSS3Parser ;
2639import org .htmlunit .cssparser .parser .media .MediaQueryList ;
2740import 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 }
0 commit comments