Skip to content

Commit 07a82fe

Browse files
committed
code style
1 parent 40713da commit 07a82fe

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

src/main/java/org/htmlunit/cyberneko/html/dom/HTMLCollectionImpl.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -357,43 +357,43 @@ protected boolean collectionMatch(final Element elem, final String name) {
357357
case ANCHOR ->
358358
// Anchor is an <A> element with a 'name' attribute. Otherwise, it's
359359
// just a link.
360-
(elem instanceof HTMLAnchorElement) && !elem.getAttribute("name").isEmpty();
360+
(elem instanceof HTMLAnchorElement) && !elem.getAttribute("name").isEmpty();
361361
case FORM ->
362362
// Any <FORM> element.
363-
elem instanceof HTMLFormElement;
363+
elem instanceof HTMLFormElement;
364364
case IMAGE ->
365365
// Any <IMG> element. <OBJECT> elements with images are not returned.
366-
elem instanceof HTMLImageElement;
366+
elem instanceof HTMLImageElement;
367367
case APPLET ->
368368
// Any <APPLET> element, and any <OBJECT> element which represents an
369369
// Applet. This is determined by 'codetype' attribute being
370370
// 'application/java' or 'classid' attribute starting with 'java:'.
371-
(elem instanceof HTMLAppletElement)
372-
|| (elem instanceof HTMLObjectElement
371+
(elem instanceof HTMLAppletElement)
372+
|| (elem instanceof HTMLObjectElement
373373
&& ("application/java".equals(elem.getAttribute("codetype"))
374-
|| elem.getAttribute("classid").startsWith("java:")));
374+
|| elem.getAttribute("classid").startsWith("java:")));
375375
case ELEMENT ->
376376
// All form elements implement HTMLFormControl for easy identification.
377-
elem instanceof HTMLFormControl;
377+
elem instanceof HTMLFormControl;
378378
case LINK ->
379379
// Any <A> element, and any <AREA> elements with an 'href' attribute.
380-
(elem instanceof HTMLAnchorElement || elem instanceof HTMLAreaElement)
381-
&& !elem.getAttribute("href").isEmpty();
380+
(elem instanceof HTMLAnchorElement || elem instanceof HTMLAreaElement)
381+
&& !elem.getAttribute("href").isEmpty();
382382
case AREA ->
383383
// Any <AREA> element.
384-
elem instanceof HTMLAreaElement;
384+
elem instanceof HTMLAreaElement;
385385
case OPTION ->
386386
// Any <OPTION> element.
387-
elem instanceof HTMLOptionElement;
387+
elem instanceof HTMLOptionElement;
388388
case ROW ->
389389
// Any <TR> element.
390-
elem instanceof HTMLTableRowElement;
390+
elem instanceof HTMLTableRowElement;
391391
case TBODY ->
392392
// Any <TBODY> element (one of three table section types).
393-
elem instanceof HTMLTableSectionElement && "TBODY".equalsIgnoreCase(elem.getTagName());
393+
elem instanceof HTMLTableSectionElement && "TBODY".equalsIgnoreCase(elem.getTagName());
394394
case CELL ->
395395
// Any <TD> or <TH> element.
396-
elem instanceof HTMLTableCellElement;
396+
elem instanceof HTMLTableCellElement;
397397
default -> match;
398398
};
399399

src/main/java/org/htmlunit/cyberneko/xerces/util/URI.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import java.io.IOException;
1818
import java.util.Locale;
19+
import java.util.Objects;
1920

2021
/**
2122
* A class to represent a Uniform Resource Identifier (URI). This class is
@@ -698,8 +699,8 @@ else if (!path_.isEmpty()) {
698699
// path segment not equal to ".."
699700
index = 1;
700701
while ((index = path.indexOf("/../", index)) > 0) {
701-
String tempString = path.substring(0, path.indexOf("/../"));
702-
int segIndex = tempString.lastIndexOf('/');
702+
final String tempString = path.substring(0, path.indexOf("/../"));
703+
final int segIndex = tempString.lastIndexOf('/');
703704
if (segIndex != -1) {
704705
if (!"..".equals(tempString.substring(segIndex))) {
705706
path = path.substring(0, segIndex + 1).concat(path.substring(index + 4));
@@ -717,8 +718,8 @@ else if (!path_.isEmpty()) {
717718
// 6f - remove ending "<segment>/.." where "<segment>" is a
718719
// complete path segment
719720
if (path.endsWith("/..")) {
720-
String tempString = path.substring(0, path.length() - 3);
721-
int segIndex = tempString.lastIndexOf('/');
721+
final String tempString = path.substring(0, path.length() - 3);
722+
final int segIndex = tempString.lastIndexOf('/');
722723
if (segIndex != -1) {
723724
path = path.substring(0, segIndex + 1);
724725
}
@@ -1402,6 +1403,11 @@ public boolean equals(final Object test) {
14021403
return false;
14031404
}
14041405

1406+
@Override
1407+
public int hashCode() {
1408+
return Objects.hash(scheme_, userinfo_, host_, port_, path_, queryString_, fragment_);
1409+
}
1410+
14051411
/**
14061412
* Get the URI as a string specification. See RFC 2396 Section 5.2.
14071413
*

0 commit comments

Comments
 (0)