Skip to content

Commit c383f59

Browse files
committed
cleanup
1 parent df5a9c1 commit c383f59

20 files changed

+115
-163
lines changed

src/main/java/org/htmlunit/cssparser/dom/CSSCharsetRuleImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.htmlunit.cssparser.parser.CSSException;
2020
import org.htmlunit.cssparser.parser.CSSOMParser;
21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222
import org.w3c.dom.DOMException;
2323

2424
/**
@@ -95,13 +95,13 @@ public boolean equals(final Object obj) {
9595
}
9696
final CSSCharsetRuleImpl ccr = (CSSCharsetRuleImpl) obj;
9797
return super.equals(obj)
98-
&& LangUtils.equals(getEncoding(), ccr.getEncoding());
98+
&& ParserUtils.equals(getEncoding(), ccr.getEncoding());
9999
}
100100

101101
@Override
102102
public int hashCode() {
103103
int hash = super.hashCode();
104-
hash = LangUtils.hashCode(hash, encoding_);
104+
hash = ParserUtils.hashCode(hash, encoding_);
105105
return hash;
106106
}
107107

src/main/java/org/htmlunit/cssparser/dom/CSSFontFaceRuleImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.htmlunit.cssparser.parser.CSSException;
2020
import org.htmlunit.cssparser.parser.CSSOMParser;
21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222
import org.w3c.dom.DOMException;
2323

2424
/**
@@ -116,13 +116,13 @@ public boolean equals(final Object obj) {
116116
}
117117
final CSSFontFaceRuleImpl cffr = (CSSFontFaceRuleImpl) obj;
118118
return super.equals(obj)
119-
&& LangUtils.equals(getStyle(), cffr.getStyle());
119+
&& ParserUtils.equals(getStyle(), cffr.getStyle());
120120
}
121121

122122
@Override
123123
public int hashCode() {
124124
int hash = super.hashCode();
125-
hash = LangUtils.hashCode(hash, style_);
125+
hash = ParserUtils.hashCode(hash, style_);
126126
return hash;
127127
}
128128

src/main/java/org/htmlunit/cssparser/dom/CSSImportRuleImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.htmlunit.cssparser.parser.CSSException;
2020
import org.htmlunit.cssparser.parser.CSSOMParser;
21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222
import org.w3c.dom.DOMException;
2323

2424
/**
@@ -140,15 +140,15 @@ public boolean equals(final Object obj) {
140140
}
141141
final CSSImportRuleImpl cir = (CSSImportRuleImpl) obj;
142142
return super.equals(obj)
143-
&& LangUtils.equals(getHref(), cir.getHref())
144-
&& LangUtils.equals(getMedia(), cir.getMedia());
143+
&& ParserUtils.equals(getHref(), cir.getHref())
144+
&& ParserUtils.equals(getMedia(), cir.getMedia());
145145
}
146146

147147
@Override
148148
public int hashCode() {
149149
int hash = super.hashCode();
150-
hash = LangUtils.hashCode(hash, href_);
151-
hash = LangUtils.hashCode(hash, media_);
150+
hash = ParserUtils.hashCode(hash, href_);
151+
hash = ParserUtils.hashCode(hash, media_);
152152
return hash;
153153
}
154154
}

src/main/java/org/htmlunit/cssparser/dom/CSSMediaRuleImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import org.htmlunit.cssparser.parser.CSSException;
2222
import org.htmlunit.cssparser.parser.CSSOMParser;
23-
import org.htmlunit.cssparser.util.LangUtils;
23+
import org.htmlunit.cssparser.util.ParserUtils;
2424
import org.htmlunit.cssparser.util.ThrowCssExceptionErrorHandler;
2525
import org.w3c.dom.DOMException;
2626

@@ -196,15 +196,15 @@ public boolean equals(final Object obj) {
196196
}
197197
final CSSMediaRuleImpl cmr = (CSSMediaRuleImpl) obj;
198198
return super.equals(obj)
199-
&& LangUtils.equals(getMediaList(), cmr.getMediaList())
200-
&& LangUtils.equals(getCssRules(), cmr.getCssRules());
199+
&& ParserUtils.equals(getMediaList(), cmr.getMediaList())
200+
&& ParserUtils.equals(getCssRules(), cmr.getCssRules());
201201
}
202202

203203
@Override
204204
public int hashCode() {
205205
int hash = super.hashCode();
206-
hash = LangUtils.hashCode(hash, mediaList_);
207-
hash = LangUtils.hashCode(hash, cssRules_);
206+
hash = ParserUtils.hashCode(hash, mediaList_);
207+
hash = ParserUtils.hashCode(hash, cssRules_);
208208
return hash;
209209
}
210210

src/main/java/org/htmlunit/cssparser/dom/CSSPageRuleImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.htmlunit.cssparser.parser.CSSException;
2020
import org.htmlunit.cssparser.parser.CSSOMParser;
21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222
import org.htmlunit.cssparser.util.ThrowCssExceptionErrorHandler;
2323
import org.w3c.dom.DOMException;
2424

@@ -177,15 +177,15 @@ public boolean equals(final Object obj) {
177177
}
178178
final CSSPageRuleImpl cpr = (CSSPageRuleImpl) obj;
179179
return super.equals(obj)
180-
&& LangUtils.equals(getSelectorText(), cpr.getSelectorText())
181-
&& LangUtils.equals(getStyle(), cpr.getStyle());
180+
&& ParserUtils.equals(getSelectorText(), cpr.getSelectorText())
181+
&& ParserUtils.equals(getStyle(), cpr.getStyle());
182182
}
183183

184184
@Override
185185
public int hashCode() {
186186
int hash = super.hashCode();
187-
hash = LangUtils.hashCode(hash, pseudoPage_);
188-
hash = LangUtils.hashCode(hash, style_);
187+
hash = ParserUtils.hashCode(hash, pseudoPage_);
188+
hash = ParserUtils.hashCode(hash, style_);
189189
return hash;
190190
}
191191

src/main/java/org/htmlunit/cssparser/dom/CSSRuleListImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.ArrayList;
1919
import java.util.List;
2020

21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222

2323
/**
2424
* Implementation of CSSRuleList.
@@ -106,7 +106,7 @@ private boolean equalsRules(final CSSRuleListImpl crl) {
106106
int i = 0;
107107
for (final AbstractCSSRuleImpl rule : rules_) {
108108
final AbstractCSSRuleImpl cssRule2 = crl.rules_.get(i);
109-
if (!LangUtils.equals(rule, cssRule2)) {
109+
if (!ParserUtils.equals(rule, cssRule2)) {
110110
return false;
111111
}
112112
i++;
@@ -116,8 +116,8 @@ private boolean equalsRules(final CSSRuleListImpl crl) {
116116

117117
@Override
118118
public int hashCode() {
119-
int hash = LangUtils.HASH_SEED;
120-
hash = LangUtils.hashCode(hash, rules_);
119+
int hash = ParserUtils.HASH_SEED;
120+
hash = ParserUtils.hashCode(hash, rules_);
121121
return hash;
122122
}
123123
}

src/main/java/org/htmlunit/cssparser/dom/CSSStyleDeclarationImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import org.htmlunit.cssparser.parser.CSSErrorHandler;
2222
import org.htmlunit.cssparser.parser.CSSOMParser;
23-
import org.htmlunit.cssparser.util.LangUtils;
23+
import org.htmlunit.cssparser.util.ParserUtils;
2424
import org.htmlunit.cssparser.util.ThrowCssExceptionErrorHandler;
2525
import org.w3c.dom.DOMException;
2626

@@ -265,12 +265,12 @@ private boolean equalsProperties(final CSSStyleDeclarationImpl csd) {
265265
// CSSValue propertyCSSValue2 = csd.getPropertyCSSValue(propertyName);
266266
final String propertyValue1 = getPropertyValue(propertyName);
267267
final String propertyValue2 = csd.getPropertyValue(propertyName);
268-
if (!LangUtils.equals(propertyValue1, propertyValue2)) {
268+
if (!ParserUtils.equals(propertyValue1, propertyValue2)) {
269269
return false;
270270
}
271271
final String propertyPriority1 = getPropertyPriority(propertyName);
272272
final String propertyPriority2 = csd.getPropertyPriority(propertyName);
273-
if (!LangUtils.equals(propertyPriority1, propertyPriority2)) {
273+
if (!ParserUtils.equals(propertyPriority1, propertyPriority2)) {
274274
return false;
275275
}
276276
}
@@ -279,10 +279,10 @@ private boolean equalsProperties(final CSSStyleDeclarationImpl csd) {
279279

280280
@Override
281281
public int hashCode() {
282-
int hash = LangUtils.HASH_SEED;
282+
int hash = ParserUtils.HASH_SEED;
283283
// don't use parentRule in hashCode()
284284
// recursive loop -> stack overflow!
285-
hash = LangUtils.hashCode(hash, properties_);
285+
hash = ParserUtils.hashCode(hash, properties_);
286286
return hash;
287287
}
288288
}

src/main/java/org/htmlunit/cssparser/dom/CSSStyleRuleImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.htmlunit.cssparser.parser.CSSException;
2020
import org.htmlunit.cssparser.parser.CSSOMParser;
2121
import org.htmlunit.cssparser.parser.selector.SelectorList;
22-
import org.htmlunit.cssparser.util.LangUtils;
22+
import org.htmlunit.cssparser.util.ParserUtils;
2323
import org.w3c.dom.DOMException;
2424

2525
/**
@@ -174,15 +174,15 @@ public boolean equals(final Object obj) {
174174
}
175175
final CSSStyleRuleImpl csr = (CSSStyleRuleImpl) obj;
176176
return super.equals(obj)
177-
&& LangUtils.equals(getSelectorText(), csr.getSelectorText())
178-
&& LangUtils.equals(getStyle(), csr.getStyle());
177+
&& ParserUtils.equals(getSelectorText(), csr.getSelectorText())
178+
&& ParserUtils.equals(getStyle(), csr.getStyle());
179179
}
180180

181181
@Override
182182
public int hashCode() {
183183
int hash = super.hashCode();
184-
hash = LangUtils.hashCode(hash, selectors_);
185-
hash = LangUtils.hashCode(hash, style_);
184+
hash = ParserUtils.hashCode(hash, selectors_);
185+
hash = ParserUtils.hashCode(hash, style_);
186186
return hash;
187187
}
188188
}

src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetImpl.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.htmlunit.cssparser.parser.media.MediaQueryList;
3333
import org.htmlunit.cssparser.parser.selector.ElementSelector;
3434
import org.htmlunit.cssparser.parser.selector.Selector;
35-
import org.htmlunit.cssparser.util.LangUtils;
35+
import org.htmlunit.cssparser.util.ParserUtils;
3636
import org.htmlunit.cssparser.util.ThrowCssExceptionErrorHandler;
3737
import org.w3c.dom.DOMException;
3838
import org.w3c.dom.Node;
@@ -302,23 +302,23 @@ public boolean equals(final Object obj) {
302302
return false;
303303
}
304304
final CSSStyleSheetImpl css = (CSSStyleSheetImpl) obj;
305-
boolean eq = LangUtils.equals(getCssRules(), css.getCssRules());
305+
boolean eq = ParserUtils.equals(getCssRules(), css.getCssRules());
306306
eq = eq && (getDisabled() == css.getDisabled());
307-
eq = eq && LangUtils.equals(getHref(), css.getHref());
308-
eq = eq && LangUtils.equals(getMedia(), css.getMedia());
309-
eq = eq && LangUtils.equals(getTitle(), css.getTitle());
307+
eq = eq && ParserUtils.equals(getHref(), css.getHref());
308+
eq = eq && ParserUtils.equals(getMedia(), css.getMedia());
309+
eq = eq && ParserUtils.equals(getTitle(), css.getTitle());
310310
return eq;
311311
}
312312

313313
@Override
314314
public int hashCode() {
315-
int hash = LangUtils.HASH_SEED;
316-
hash = LangUtils.hashCode(hash, cssRules_);
317-
hash = LangUtils.hashCode(hash, disabled_);
318-
hash = LangUtils.hashCode(hash, href_);
319-
hash = LangUtils.hashCode(hash, media_);
320-
hash = LangUtils.hashCode(hash, ownerNode_);
321-
hash = LangUtils.hashCode(hash, title_);
315+
int hash = ParserUtils.HASH_SEED;
316+
hash = ParserUtils.hashCode(hash, cssRules_);
317+
hash = ParserUtils.hashCode(hash, disabled_);
318+
hash = ParserUtils.hashCode(hash, href_);
319+
hash = ParserUtils.hashCode(hash, media_);
320+
hash = ParserUtils.hashCode(hash, ownerNode_);
321+
hash = ParserUtils.hashCode(hash, title_);
322322
return hash;
323323
}
324324

src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetListImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.Iterator;
1919
import java.util.List;
2020

21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222

2323
/**
2424
* Implementation of StyleSheetList.
@@ -94,7 +94,7 @@ private boolean equalsStyleSheets(final CSSStyleSheetListImpl ssl) {
9494
int i = 0;
9595
for (final CSSStyleSheetImpl styleSheet : cssStyleSheets_) {
9696
final CSSStyleSheetImpl styleSheet2 = ssl.cssStyleSheets_.get(i);
97-
if (!LangUtils.equals(styleSheet, styleSheet2)) {
97+
if (!ParserUtils.equals(styleSheet, styleSheet2)) {
9898
return false;
9999
}
100100
i++;
@@ -104,8 +104,8 @@ private boolean equalsStyleSheets(final CSSStyleSheetListImpl ssl) {
104104

105105
@Override
106106
public int hashCode() {
107-
int hash = LangUtils.HASH_SEED;
108-
hash = LangUtils.hashCode(hash, cssStyleSheets_);
107+
int hash = ParserUtils.HASH_SEED;
108+
hash = ParserUtils.hashCode(hash, cssStyleSheets_);
109109
return hash;
110110
}
111111

src/main/java/org/htmlunit/cssparser/dom/CSSUnknownRuleImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.htmlunit.cssparser.parser.CSSException;
2020
import org.htmlunit.cssparser.parser.CSSOMParser;
21-
import org.htmlunit.cssparser.util.LangUtils;
21+
import org.htmlunit.cssparser.util.ParserUtils;
2222
import org.w3c.dom.DOMException;
2323

2424
/**
@@ -103,13 +103,13 @@ public boolean equals(final Object obj) {
103103
}
104104
final CSSUnknownRuleImpl cur = (CSSUnknownRuleImpl) obj;
105105
return super.equals(obj)
106-
&& LangUtils.equals(getCssText(), cur.getCssText());
106+
&& ParserUtils.equals(getCssText(), cur.getCssText());
107107
}
108108

109109
@Override
110110
public int hashCode() {
111111
int hash = super.hashCode();
112-
hash = LangUtils.hashCode(hash, text_);
112+
hash = ParserUtils.hashCode(hash, text_);
113113
return hash;
114114
}
115115

src/main/java/org/htmlunit/cssparser/dom/CSSValueImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import org.htmlunit.cssparser.parser.CSSOMParser;
2424
import org.htmlunit.cssparser.parser.LexicalUnit;
2525
import org.htmlunit.cssparser.parser.LexicalUnit.LexicalUnitType;
26+
import org.htmlunit.cssparser.util.ParserUtils;
2627
import org.htmlunit.cssparser.parser.LexicalUnitImpl;
27-
import org.htmlunit.cssparser.util.LangUtils;
2828
import org.w3c.dom.DOMException;
2929

3030
/**
@@ -515,13 +515,13 @@ public boolean equals(final Object obj) {
515515
// TODO to be improved!
516516
return super.equals(obj)
517517
&& (getCssValueType() == cv.getCssValueType())
518-
&& LangUtils.equals(getCssText(), cv.getCssText());
518+
&& ParserUtils.equals(getCssText(), cv.getCssText());
519519
}
520520

521521
@Override
522522
public int hashCode() {
523523
int hash = super.hashCode();
524-
hash = LangUtils.hashCode(hash, value_);
524+
hash = ParserUtils.hashCode(hash, value_);
525525
return hash;
526526
}
527527

src/main/java/org/htmlunit/cssparser/dom/MediaListImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.htmlunit.cssparser.parser.CSSParseException;
2525
import org.htmlunit.cssparser.parser.media.MediaQuery;
2626
import org.htmlunit.cssparser.parser.media.MediaQueryList;
27-
import org.htmlunit.cssparser.util.LangUtils;
27+
import org.htmlunit.cssparser.util.ParserUtils;
2828
import org.htmlunit.cssparser.util.ThrowCssExceptionErrorHandler;
2929
import org.w3c.dom.DOMException;
3030

@@ -137,7 +137,7 @@ private boolean equalsMedia(final MediaListImpl ml) {
137137
for (final MediaQuery mediaQuery : mediaQueries_) {
138138
final String m1 = mediaQuery.getMedia();
139139
final String m2 = ml.mediaQuery(i).getMedia();
140-
if (!LangUtils.equals(m1, m2)) {
140+
if (!ParserUtils.equals(m1, m2)) {
141141
return false;
142142
}
143143
i++;
@@ -160,7 +160,7 @@ public boolean equals(final Object obj) {
160160
@Override
161161
public int hashCode() {
162162
int hash = super.hashCode();
163-
hash = LangUtils.hashCode(hash, mediaQueries_);
163+
hash = ParserUtils.hashCode(hash, mediaQueries_);
164164
return hash;
165165
}
166166
}

0 commit comments

Comments
 (0)