Skip to content

Commit 5528b27

Browse files
committed
cleanup
1 parent 995b0b2 commit 5528b27

25 files changed

Lines changed: 81 additions & 72 deletions

src/main/java/org/htmlunit/BrowserVersionFeatures.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public enum BrowserVersionFeatures {
328328
@BrowserFeature({CHROME, EDGE, FF, FF_ESR})
329329
HTMLALLCOLLECTION_NULL_IF_NAMED_ITEM_NOT_FOUND,
330330

331-
/** Should {@link org.htmlunit.javascript.host.html.HTMLBaseFontElement#isEndTagForbidden}. */
331+
/** Should org.htmlunit.javascript.host.html.HTMLBaseFontElement#isEndTagForbidden(). */
332332
@BrowserFeature({FF, FF_ESR})
333333
HTMLBASEFONT_END_TAG_FORBIDDEN,
334334

@@ -525,7 +525,7 @@ public enum BrowserVersionFeatures {
525525
@BrowserFeature(IE)
526526
HTMLTEXTAREA_WILL_VALIDATE_IGNORES_READONLY,
527527

528-
/** Should {@link org.htmlunit.javascript.host.html.HTMLTrackElement#isEndTagForbidden}. */
528+
/** Should org.htmlunit.javascript.host.html.HTMLTrackElement#isEndTagForbidden(). */
529529
@BrowserFeature({FF, FF_ESR, IE})
530530
HTMLTRACK_END_TAG_FORBIDDEN,
531531

src/main/java/org/htmlunit/Cache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void touch() {
113113
* Is this cached entry still fresh?
114114
* @param now the current time
115115
* @return <code>true</code> if can keep in the cache
116-
* @see {@link #isWithinCacheWindow(WebResponse, long, long)}
116+
* @see #isWithinCacheWindow(WebResponse, long, long)
117117
*/
118118
boolean isStillFresh(final long now) {
119119
return Cache.isWithinCacheWindow(response_, now, createdAt_);

src/main/java/org/htmlunit/DefaultPageCreator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public class DefaultPageCreator implements PageCreator, Serializable {
8585
private static final byte[] markerUTF16LE_ = {(byte) 0xff, (byte) 0xfe};
8686

8787
/**
88-
* See http://tools.ietf.org/html/draft-abarth-mime-sniff-05
88+
* See <a href="http://tools.ietf.org/html/draft-abarth-mime-sniff-05">
89+
* http://tools.ietf.org/html/draft-abarth-mime-sniff-05</a>
8990
*/
9091
private static final String[] htmlPatterns = {"!DOCTYPE HTML", "HTML", "HEAD", "SCRIPT",
9192
"IFRAME", "H1", "DIV", "FONT", "TABLE", "A", "STYLE", "TITLE", "B", "BODY", "BR", "P", "!--" };
@@ -246,7 +247,8 @@ public HTMLParser getHtmlParser() {
246247
}
247248

248249
/**
249-
* See http://tools.ietf.org/html/draft-abarth-mime-sniff-05#section-4
250+
* See <a href="http://tools.ietf.org/html/draft-abarth-mime-sniff-05#section-4">
251+
* http://tools.ietf.org/html/draft-abarth-mime-sniff-05#section-4</a>
250252
* @param bytes the bytes to check
251253
*/
252254
private static boolean isBinary(final byte[] bytes) {

src/main/java/org/htmlunit/WebAssert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public static void assertAllTabIndexAttributesSet(final HtmlPage page) {
416416
for (final String tag : tags) {
417417
for (final HtmlElement element : page.getDocumentElement().getElementsByTagName(tag)) {
418418
final Short tabIndex = element.getTabIndex();
419-
if (tabIndex == null || tabIndex == HtmlElement.TAB_INDEX_OUT_OF_BOUNDS) {
419+
if (tabIndex == null || HtmlElement.TAB_INDEX_OUT_OF_BOUNDS.equals(tabIndex)) {
420420
final String s = element.getAttributeDirect("tabindex");
421421
throw new AssertionError("Illegal value for tab index: '" + s + "'.");
422422
}

src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class ElementCssStyleDeclaration extends AbstractCssStyleDeclaration {
4444
// private static final Log LOG = LogFactory.getLog(ElementCssStyleDeclaration.class);
4545

4646
/** The DomElement. */
47-
private DomElement domElement_;
47+
private final DomElement domElement_;
4848

4949
/**
5050
* Creates an instance which backed by the given dom element.

src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class WrappedCssStyleDeclaration extends AbstractCssStyleDeclaration {
4444
// private static final Log LOG = LogFactory.getLog(WrappedCssStyleDeclaration.class);
4545

4646
/** The wrapped CSSStyleDeclaration. */
47-
private CSSStyleDeclarationImpl cssStyleDeclarationImpl_;
47+
private final CSSStyleDeclarationImpl cssStyleDeclarationImpl_;
4848

4949
/**
5050
* Creates an instance which wraps the specified style declaration implementation.

src/main/java/org/htmlunit/html/HtmlPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ public List<HtmlElement> getTabbableElements() {
811811
final String tagName = element.getTagName();
812812
if (TABBABLE_TAGS.contains(tagName)) {
813813
final boolean disabled = element.hasAttribute(ATTRIBUTE_DISABLED);
814-
if (!disabled && element.getTabIndex() != HtmlElement.TAB_INDEX_OUT_OF_BOUNDS) {
814+
if (!disabled && !HtmlElement.TAB_INDEX_OUT_OF_BOUNDS.equals(element.getTabIndex())) {
815815
tabbableElements.add(element);
816816
}
817817
}

src/main/java/org/htmlunit/html/xpath/XPathAdapter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ private void initFunctionTable() {
5757
/**
5858
* Constructor.
5959
* @param exprString the XPath expression
60-
* @param locator the location of the expression, may be {@code null}
6160
* @param prefixResolver a prefix resolver to use to resolve prefixes to namespace URIs
6261
* @param errorListener the error listener, or {@code null} if default should be used
6362
* @param caseSensitive whether the attributes should be case-sensitive

src/main/java/org/htmlunit/javascript/host/Location.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,36 +115,36 @@ public class Location extends HtmlUnitScriptable {
115115

116116
static {
117117
try {
118-
methodAssign = Location.class.getDeclaredMethod("assign", new Class[] {String.class});
119-
methodReload = Location.class.getDeclaredMethod("reload", new Class[] {boolean.class});
120-
methodReplace = Location.class.getDeclaredMethod("replace", new Class[] {String.class});
121-
methodToString = Location.class.getDeclaredMethod("jsToString", new Class[] {});
118+
methodAssign = Location.class.getDeclaredMethod("assign", String.class);
119+
methodReload = Location.class.getDeclaredMethod("reload", boolean.class);
120+
methodReplace = Location.class.getDeclaredMethod("replace", String.class);
121+
methodToString = Location.class.getDeclaredMethod("jsToString");
122122

123-
getterHash = Location.class.getDeclaredMethod("getHash", new Class[] {});
124-
setterHash = Location.class.getDeclaredMethod("setHash", new Class[] {String.class});
123+
getterHash = Location.class.getDeclaredMethod("getHash");
124+
setterHash = Location.class.getDeclaredMethod("setHash", String.class);
125125

126-
getterHost = Location.class.getDeclaredMethod("getHost", new Class[] {});
127-
setterHost = Location.class.getDeclaredMethod("setHost", new Class[] {String.class});
126+
getterHost = Location.class.getDeclaredMethod("getHost");
127+
setterHost = Location.class.getDeclaredMethod("setHost", String.class);
128128

129-
getterHostname = Location.class.getDeclaredMethod("getHostname", new Class[] {});
130-
setterHostname = Location.class.getDeclaredMethod("setHostname", new Class[] {String.class});
129+
getterHostname = Location.class.getDeclaredMethod("getHostname");
130+
setterHostname = Location.class.getDeclaredMethod("setHostname", String.class);
131131

132-
getterHref = Location.class.getDeclaredMethod("getHref", new Class[] {});
133-
setterHref = Location.class.getDeclaredMethod("setHref", new Class[] {String.class});
132+
getterHref = Location.class.getDeclaredMethod("getHref");
133+
setterHref = Location.class.getDeclaredMethod("setHref", String.class);
134134

135-
getterOrigin = Location.class.getDeclaredMethod("getOrigin", new Class[] {});
135+
getterOrigin = Location.class.getDeclaredMethod("getOrigin");
136136

137-
getterPathname = Location.class.getDeclaredMethod("getPathname", new Class[] {});
138-
setterPathname = Location.class.getDeclaredMethod("setPathname", new Class[] {String.class});
137+
getterPathname = Location.class.getDeclaredMethod("getPathname");
138+
setterPathname = Location.class.getDeclaredMethod("setPathname", String.class);
139139

140-
getterPort = Location.class.getDeclaredMethod("getPort", new Class[] {});
141-
setterPort = Location.class.getDeclaredMethod("setPort", new Class[] {String.class});
140+
getterPort = Location.class.getDeclaredMethod("getPort");
141+
setterPort = Location.class.getDeclaredMethod("setPort", String.class);
142142

143-
getterProtocol = Location.class.getDeclaredMethod("getProtocol", new Class[] {});
144-
setterProtocol = Location.class.getDeclaredMethod("setProtocol", new Class[] {String.class});
143+
getterProtocol = Location.class.getDeclaredMethod("getProtocol");
144+
setterProtocol = Location.class.getDeclaredMethod("setProtocol", String.class);
145145

146-
getterSearch = Location.class.getDeclaredMethod("getSearch", new Class[] {});
147-
setterSearch = Location.class.getDeclaredMethod("setSearch", new Class[] {String.class});
146+
getterSearch = Location.class.getDeclaredMethod("getSearch");
147+
setterSearch = Location.class.getDeclaredMethod("setSearch", String.class);
148148
}
149149
catch (NoSuchMethodException | SecurityException e) {
150150
throw new RuntimeException(e);

src/main/java/org/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ public int getContentHeight() {
11271127
final HtmlTableRow row = (HtmlTableRow) node;
11281128
for (final HtmlTableCell cell : row.getCellIterator()) {
11291129
if (cell.mayBeDisplayed()) {
1130-
final HTMLElement e = (HTMLElement) cell.getScriptableObject();
1130+
final HTMLElement e = cell.getScriptableObject();
11311131
final ComputedCSSStyleDeclaration style = e.getWindow().getComputedStyle(e, null);
11321132
styles.add(style);
11331133
}

0 commit comments

Comments
 (0)