From fc007ef22d3c380a2154877d42c46779d2b839f9 Mon Sep 17 00:00:00 2001 From: rbri Date: Fri, 29 Mar 2019 20:14:38 +0100 Subject: [PATCH] fix a bunch of warnings --- .../gargoylesoftware/css/dom/CSSCharsetRuleImpl.java | 11 +++++------ .../css/dom/CSSFontFaceRuleImpl.java | 9 ++++----- .../gargoylesoftware/css/dom/CSSImportRuleImpl.java | 9 ++++----- .../gargoylesoftware/css/dom/CSSMediaRuleImpl.java | 12 +++++------- .../gargoylesoftware/css/dom/CSSPageRuleImpl.java | 9 ++++----- .../gargoylesoftware/css/dom/CSSRuleListImpl.java | 2 +- .../css/dom/CSSStyleDeclarationImpl.java | 5 ++--- .../gargoylesoftware/css/dom/CSSStyleRuleImpl.java | 12 +++++------- .../gargoylesoftware/css/dom/CSSStyleSheetImpl.java | 10 ++++------ .../css/dom/CSSStyleSheetListImpl.java | 2 +- .../gargoylesoftware/css/dom/CSSUnknownRuleImpl.java | 9 ++++----- .../com/gargoylesoftware/css/dom/CSSValueImpl.java | 7 +++---- .../com/gargoylesoftware/css/dom/MediaListImpl.java | 5 ++--- .../css/parser/AbstractCSSParser.java | 2 +- .../com/gargoylesoftware/css/parser/CSSOMParser.java | 4 ++-- .../css/parser/media/MediaQuery.java | 2 +- .../css/parser/media/MediaQueryList.java | 2 +- .../css/parser/selector/ChildSelector.java | 4 +--- .../css/parser/selector/DescendantSelector.java | 4 +--- .../css/parser/selector/DirectAdjacentSelector.java | 4 +--- .../css/parser/selector/ElementSelector.java | 5 ++--- .../css/parser/selector/GeneralAdjacentSelector.java | 4 +--- .../css/parser/selector/PseudoElementSelector.java | 4 +--- .../css/parser/selector/SelectorListImpl.java | 2 +- 24 files changed, 57 insertions(+), 82 deletions(-) diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSCharsetRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSCharsetRuleImpl.java index 233a20d..5ffffd4 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSCharsetRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSCharsetRuleImpl.java @@ -49,13 +49,11 @@ public CSSCharsetRuleImpl( } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); @@ -116,8 +114,9 @@ public String toString() { } /** - * @return the current css text + * {@inheritDoc} */ + @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSFontFaceRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSFontFaceRuleImpl.java index dc673dc..788f6aa 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSFontFaceRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSFontFaceRuleImpl.java @@ -45,6 +45,7 @@ public CSSFontFaceRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final Abstr /** * {@inheritDoc} */ + @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); sb.append("@font-face {"); @@ -58,13 +59,11 @@ public String getCssText() { } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSImportRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSImportRuleImpl.java index b123cd1..5c9ddee 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSImportRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSImportRuleImpl.java @@ -55,6 +55,7 @@ public CSSImportRuleImpl( /** * {@inheritDoc} */ + @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); sb.append("@import"); @@ -73,13 +74,11 @@ public String getCssText() { } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSMediaRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSMediaRuleImpl.java index 3c31e0f..1adf79b 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSMediaRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSMediaRuleImpl.java @@ -54,6 +54,7 @@ public CSSMediaRuleImpl( /** * {@inheritDoc} */ + @Override public String getCssText() { final StringBuilder sb = new StringBuilder("@media "); @@ -68,13 +69,11 @@ public String getCssText() { } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); @@ -129,8 +128,7 @@ public CSSRuleListImpl getCssRules() { public void insertRule(final String rule, final int index) throws DOMException { final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet(); - try { - final InputSource is = new InputSource(new StringReader(rule)); + try (InputSource is = new InputSource(new StringReader(rule))) { final CSSOMParser parser = new CSSOMParser(); parser.setParentStyleSheet(parentStyleSheet); parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSPageRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSPageRuleImpl.java index 749a5b0..c5c96b8 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSPageRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSPageRuleImpl.java @@ -52,6 +52,7 @@ public CSSPageRuleImpl( /** * {@inheritDoc} */ + @Override public String getCssText() { final StringBuilder sb = new StringBuilder(); @@ -72,13 +73,11 @@ public String getCssText() { } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSRuleListImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSRuleListImpl.java index 2d1c2ec..961d4e7 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSRuleListImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSRuleListImpl.java @@ -27,7 +27,7 @@ */ public class CSSRuleListImpl implements Serializable { - private List rules_ = new ArrayList(); + private List rules_ = new ArrayList<>(); /** * @return the rules diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleDeclarationImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleDeclarationImpl.java index d5c09c2..9639fe7 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleDeclarationImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleDeclarationImpl.java @@ -35,7 +35,7 @@ public class CSSStyleDeclarationImpl implements Serializable { private static final String PRIORITY_IMPORTANT = "important"; private AbstractCSSRuleImpl parentRule_; - private List properties_ = new ArrayList(); + private List properties_ = new ArrayList<>(); /** * Ctor. @@ -77,8 +77,7 @@ public String getCssText() { * @throws DOMException in case of error */ public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); properties_.clear(); parser.parseStyleDeclaration(this, is); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleRuleImpl.java index 5659f7d..10df3b1 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleRuleImpl.java @@ -65,6 +65,7 @@ public void setSelectors(final SelectorList selectors) { /** * {@inheritDoc} */ + @Override public String getCssText() { final CSSStyleDeclarationImpl style = getStyle(); if (null == style) { @@ -82,13 +83,11 @@ public String getCssText() { } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); @@ -130,8 +129,7 @@ public String getSelectorText() { * @throws DOMException in clase of error */ public void setSelectorText(final String selectorText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(selectorText)); + try (InputSource is = new InputSource(new StringReader(selectorText))) { final CSSOMParser parser = new CSSOMParser(); selectors_ = parser.parseSelectors(is); } diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetImpl.java index 230fc56..b70d34b 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetImpl.java @@ -131,8 +131,7 @@ public CSSRuleListImpl getCssRules() { * @throws DOMException in case of error */ public void insertRule(final String rule, final int index) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(rule)); + try (InputSource is = new InputSource(new StringReader(rule))) { final CSSOMParser parser = new CSSOMParser(); parser.setParentStyleSheet(this); parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE); @@ -260,8 +259,7 @@ public void setTitle(final String title) { * @param mediaText the new media text */ public void setMediaText(final String mediaText) { - final InputSource source = new InputSource(new StringReader(mediaText)); - try { + try (InputSource source = new InputSource(new StringReader(mediaText))) { final CSSOMParser parser = new CSSOMParser(); final MediaQueryList sml = parser.parseMedia(source); media_ = new MediaListImpl(sml); @@ -402,7 +400,7 @@ private static final class SelectorIndex { void add(final String key, final SelectorEntry selector) { List entry = keyToSelectors_.get(key); if (entry == null) { - entry = new ArrayList(); + entry = new ArrayList<>(); keyToSelectors_.put(key, entry); } entry.add(selector); @@ -522,7 +520,7 @@ static final class SelectorEntriesIterator implements Iterator { final String elementName, final String[] classes) { - iterators_ = new LinkedList>(); + iterators_ = new LinkedList<>(); List selectors = index.elementSelectors_.get(null); if (!selectors.isEmpty()) { diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetListImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetListImpl.java index c7eb62c..2267d6d 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetListImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSStyleSheetListImpl.java @@ -33,7 +33,7 @@ public class CSSStyleSheetListImpl { */ public List getCSSStyleSheets() { if (cssStyleSheets_ == null) { - cssStyleSheets_ = new ArrayList(); + cssStyleSheets_ = new ArrayList<>(); } return cssStyleSheets_; } diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSUnknownRuleImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSUnknownRuleImpl.java index 5a9501b..ea33756 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSUnknownRuleImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSUnknownRuleImpl.java @@ -50,6 +50,7 @@ public CSSUnknownRuleImpl( /** * {@inheritDoc} */ + @Override public String getCssText() { if (null == text_) { return ""; @@ -58,13 +59,11 @@ public String getCssText() { } /** - * Sets the css text. - * @param cssText the new css text - * @throws DOMException in case of error + * {@inheritDoc} */ + @Override public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final AbstractCSSRuleImpl r = parser.parseRule(is); diff --git a/src/main/java/com/gargoylesoftware/css/dom/CSSValueImpl.java b/src/main/java/com/gargoylesoftware/css/dom/CSSValueImpl.java index 62569de..e67dea0 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/CSSValueImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/CSSValueImpl.java @@ -194,8 +194,8 @@ else if (value.getLexicalUnitType() == LexicalUnitType.COUNTERS_FUNCTION) { } } - private List getValues(final LexicalUnit value) { - final List values = new ArrayList(); + private static List getValues(final LexicalUnit value) { + final List values = new ArrayList<>(); LexicalUnit lu = value; while (lu != null) { values.add(new CSSValueImpl(lu, true)); @@ -255,8 +255,7 @@ public String getCssText() { * @throws DOMException in case of error */ public void setCssText(final String cssText) throws DOMException { - try { - final InputSource is = new InputSource(new StringReader(cssText)); + try (InputSource is = new InputSource(new StringReader(cssText))) { final CSSOMParser parser = new CSSOMParser(); final CSSValueImpl v2 = parser.parsePropertyValue(is); value_ = v2.value_; diff --git a/src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java b/src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java index ecc97f7..87fc533 100644 --- a/src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java +++ b/src/main/java/com/gargoylesoftware/css/dom/MediaListImpl.java @@ -45,7 +45,7 @@ public class MediaListImpl extends AbstractLocatable implements Serializable { * @param mediaList the media list */ public MediaListImpl(final MediaQueryList mediaList) { - mediaQueries_ = new ArrayList(10); + mediaQueries_ = new ArrayList<>(10); setMediaList(mediaList); if (mediaList != null) { @@ -77,8 +77,7 @@ public String getMediaText() { * @throws DOMException in case of error */ public void setMediaText(final String mediaText) throws DOMException { - final InputSource source = new InputSource(new StringReader(mediaText)); - try { + try (InputSource source = new InputSource(new StringReader(mediaText))) { final CSSOMParser parser = new CSSOMParser(); parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE); final MediaQueryList sml = parser.parseMedia(source); diff --git a/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java b/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java index 85ff303..c3cd958 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java +++ b/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java @@ -442,7 +442,7 @@ public MediaQueryList parseMedia(final InputSource source) throws IOException { return ml; } - private CharStream getCharStream(final InputSource source) throws IOException { + private static CharStream getCharStream(final InputSource source) throws IOException { if (source.getReader() != null) { return new CssCharStream(source.getReader(), 1, 1); } diff --git a/src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java b/src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java index de859ea..2dffe42 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java +++ b/src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java @@ -108,7 +108,7 @@ public CSSStyleDeclarationImpl parseStyleDeclaration(final InputSource source) t * @throws IOException if the underlying SAC parser throws an IOException */ public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final InputSource source) throws IOException { - final Stack nodeStack = new Stack(); + final Stack nodeStack = new Stack<>(); nodeStack.push(sd); final CSSOMHandler handler = new CSSOMHandler(nodeStack); parser_.setDocumentHandler(handler); @@ -207,7 +207,7 @@ private void setHref(final String href) { } CSSOMHandler() { - nodeStack_ = new Stack(); + nodeStack_ = new Stack<>(); } Object getRoot() { diff --git a/src/main/java/com/gargoylesoftware/css/parser/media/MediaQuery.java b/src/main/java/com/gargoylesoftware/css/parser/media/MediaQuery.java index eb19cac..8ee5b5b 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/media/MediaQuery.java +++ b/src/main/java/com/gargoylesoftware/css/parser/media/MediaQuery.java @@ -47,7 +47,7 @@ public MediaQuery(final String media) { */ public MediaQuery(final String media, final boolean isOnly, final boolean isNot) { media_ = media; - properties_ = new ArrayList(10); + properties_ = new ArrayList<>(10); isOnly_ = isOnly; isNot_ = isNot; } diff --git a/src/main/java/com/gargoylesoftware/css/parser/media/MediaQueryList.java b/src/main/java/com/gargoylesoftware/css/parser/media/MediaQueryList.java index dcb1265..3683957 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/media/MediaQueryList.java +++ b/src/main/java/com/gargoylesoftware/css/parser/media/MediaQueryList.java @@ -32,7 +32,7 @@ public class MediaQueryList extends AbstractLocatable { * Ctor. */ public MediaQueryList() { - mediaQueries_ = new ArrayList(); + mediaQueries_ = new ArrayList<>(); } /** diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/ChildSelector.java b/src/main/java/com/gargoylesoftware/css/parser/selector/ChildSelector.java index b5d6f2c..ccf8f5e 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/ChildSelector.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/ChildSelector.java @@ -14,12 +14,10 @@ */ package com.gargoylesoftware.css.parser.selector; -import java.io.Serializable; - /** * @author Ronald Brill */ -public class ChildSelector extends AbstractSelector implements Serializable { +public class ChildSelector extends AbstractSelector { private Selector ancestorSelector_; private SimpleSelector simpleSelector_; diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/DescendantSelector.java b/src/main/java/com/gargoylesoftware/css/parser/selector/DescendantSelector.java index 97f1f77..3124220 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/DescendantSelector.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/DescendantSelector.java @@ -14,12 +14,10 @@ */ package com.gargoylesoftware.css.parser.selector; -import java.io.Serializable; - /** * @author Ronald Brill */ -public class DescendantSelector extends AbstractSelector implements Serializable { +public class DescendantSelector extends AbstractSelector { private final Selector ancestorSelector_; private final SimpleSelector simpleSelector_; diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/DirectAdjacentSelector.java b/src/main/java/com/gargoylesoftware/css/parser/selector/DirectAdjacentSelector.java index 106aba5..152dca5 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/DirectAdjacentSelector.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/DirectAdjacentSelector.java @@ -14,12 +14,10 @@ */ package com.gargoylesoftware.css.parser.selector; -import java.io.Serializable; - /** * @author Ronald Brill */ -public class DirectAdjacentSelector extends AbstractSelector implements Serializable { +public class DirectAdjacentSelector extends AbstractSelector { private final Selector selector_; // child private final SimpleSelector simpleSelector_; diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/ElementSelector.java b/src/main/java/com/gargoylesoftware/css/parser/selector/ElementSelector.java index a9d5beb..433a92f 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/ElementSelector.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/ElementSelector.java @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.css.parser.selector; -import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -25,7 +24,7 @@ /** * @author Ronald Brill */ -public class ElementSelector extends AbstractSelector implements SimpleSelector, Serializable { +public class ElementSelector extends AbstractSelector implements SimpleSelector { private final String localName_; private final String localNameLC_; @@ -96,7 +95,7 @@ public List getConditions() { */ public void addCondition(final Condition condition) { if (conditions_ == null) { - conditions_ = new ArrayList(); + conditions_ = new ArrayList<>(); } conditions_.add(condition); } diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/GeneralAdjacentSelector.java b/src/main/java/com/gargoylesoftware/css/parser/selector/GeneralAdjacentSelector.java index e9917ad..c93cf4c 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/GeneralAdjacentSelector.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/GeneralAdjacentSelector.java @@ -14,12 +14,10 @@ */ package com.gargoylesoftware.css.parser.selector; -import java.io.Serializable; - /** * @author Ronald Brill */ -public class GeneralAdjacentSelector extends AbstractSelector implements Serializable { +public class GeneralAdjacentSelector extends AbstractSelector { private final Selector selector_; private final SimpleSelector simpleSelector_; diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/PseudoElementSelector.java b/src/main/java/com/gargoylesoftware/css/parser/selector/PseudoElementSelector.java index 2b51ca9..1ec7759 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/PseudoElementSelector.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/PseudoElementSelector.java @@ -14,15 +14,13 @@ */ package com.gargoylesoftware.css.parser.selector; -import java.io.Serializable; - import com.gargoylesoftware.css.parser.Locator; /** * * @author Ronald Brill */ -public class PseudoElementSelector extends AbstractSelector implements SimpleSelector, Serializable { +public class PseudoElementSelector extends AbstractSelector implements SimpleSelector { private final String localName_; private final boolean doubleColon_; diff --git a/src/main/java/com/gargoylesoftware/css/parser/selector/SelectorListImpl.java b/src/main/java/com/gargoylesoftware/css/parser/selector/SelectorListImpl.java index 704cff7..ac0475e 100644 --- a/src/main/java/com/gargoylesoftware/css/parser/selector/SelectorListImpl.java +++ b/src/main/java/com/gargoylesoftware/css/parser/selector/SelectorListImpl.java @@ -31,7 +31,7 @@ */ public class SelectorListImpl extends AbstractLocatable implements SelectorList, Serializable { - private List selectors_ = new ArrayList(); + private List selectors_ = new ArrayList<>(); /** * @return the list of selectors.