File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
src/main/java/com/gargoylesoftware/css Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 3030 */
3131public class CSSRuleListImpl implements CSSRuleList , Serializable {
3232
33- private List <CSSRule > rules_ ;
33+ private List <CSSRule > rules_ = new ArrayList < CSSRule >() ;
3434
3535 public List <CSSRule > getRules () {
36- if (rules_ == null ) {
37- rules_ = new ArrayList <CSSRule >();
38- }
3936 return rules_ ;
4037 }
4138
42- public void setRules (final List <CSSRule > rules ) {
43- rules_ = rules ;
44- }
45-
4639 public CSSRuleListImpl () {
4740 super ();
4841 }
Original file line number Diff line number Diff line change 2020import org .w3c .dom .DOMException ;
2121import org .w3c .dom .css .CSSRule ;
2222import org .w3c .dom .css .CSSStyleDeclaration ;
23- import org .w3c .dom .css .CSSStyleSheet ;
2423import org .w3c .dom .css .CSSValue ;
2524
2625import com .gargoylesoftware .css .dom .CSSCharsetRuleImpl ;
@@ -68,14 +67,14 @@ public void setErrorHandler(final CSSErrorHandler eh) {
6867 * @return the CSSOM style sheet
6968 * @throws IOException if the underlying SAC parser throws an IOException
7069 */
71- public CSSStyleSheet parseStyleSheet (final InputSource source , final String href ) throws IOException {
70+ public CSSStyleSheetImpl parseStyleSheet (final InputSource source , final String href ) throws IOException {
7271 final CSSOMHandler handler = new CSSOMHandler ();
7372 handler .setHref (href );
7473 parser_ .setDocumentHandler (handler );
7574 parser_ .parseStyleSheet (source );
7675 final Object o = handler .getRoot ();
77- if (o instanceof CSSStyleSheet ) {
78- return (CSSStyleSheet ) o ;
76+ if (o instanceof CSSStyleSheetImpl ) {
77+ return (CSSStyleSheetImpl ) o ;
7978 }
8079 return null ;
8180 }
You can’t perform that action at this time.
0 commit comments