Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,9 @@
<name>MatrixNeoKozak</name>
<email>matrixneo2026@tutamail.com</email>
</contributor>
<contributor>
<name>Ashutosh Panda</name>
</contributor>
</contributors>
<dependencies>
<!-- this includes httpclient as dependency -->
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/htmlunit/WebClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
* @author Lai Quang Duong
* @author René Schwietzke
* @author Sven Strickroth
* @author Ashutosh Panda
*/
@SuppressWarnings("PMD.TooManyFields")
public class WebClient implements Serializable, AutoCloseable {
Expand Down Expand Up @@ -2710,11 +2711,7 @@ public boolean isOutdated() {
return true;
}

if (requestingWindow_.getEnclosedPage() != originalPage_.get()) {
return true;
}

return false;
return requestingWindow_.getEnclosedPage() != originalPage_.get();
}
}

Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/htmlunit/css/CssStyleSheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
* @author Frank Danek
* @author Carsten Steul
* @author Sven Strickroth
* @author Ashutosh Panda
*/
public class CssStyleSheet implements Serializable {

Expand Down Expand Up @@ -538,11 +539,8 @@ && selects(browserVersion, domElement, gas.getSelector(),

case NEXT_SIBLING_COMBINATOR:
final DomElement nextSibling = element.getNextElementSibling();
if (nextSibling != null && selects(browserVersion, nextSibling, rs.getSelector(), pseudoElement,
scope, fromQuerySelectorAll, throwOnSyntax)) {
return true;
}
return false;
return nextSibling != null && selects(browserVersion, nextSibling, rs.getSelector(), pseudoElement,
scope, fromQuerySelectorAll, throwOnSyntax);

case SUBSEQUENT_SIBLING_COMBINATOR:
for (DomNode n = element.getNextSibling(); n != null; n = n.getNextSibling()) {
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/htmlunit/html/impl/Color.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* independent of awt (for this).
*
* @author Ronald Brill
* @author Ashutosh Panda
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public class Color {
Expand Down Expand Up @@ -137,9 +138,6 @@ public boolean equals(final Object obj) {
if (green_ != other.green_) {
return false;
}
if (red_ != other.red_) {
return false;
}
return true;
return red_ == other.red_;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
* @author Thorsten Wendelmuth
* @author Lai Quang Duong
* @author Sven Strickroth
* @author Ashutosh Panda
*
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest">MDN Documentation</a>
*/
Expand Down Expand Up @@ -1231,15 +1232,12 @@ private static boolean isPreflightHeader(final String name, final String value)
&& !lcValue.startsWith(FormEncodingType.MULTIPART.getName())
&& !lcValue.startsWith(FormEncodingType.TEXT_PLAIN.getName());
}
if (HttpHeader.ACCEPT_LC.equals(name)
return !(HttpHeader.ACCEPT_LC.equals(name)
|| HttpHeader.ACCEPT_LANGUAGE_LC.equals(name)
|| HttpHeader.CONTENT_LANGUAGE_LC.equals(name)
|| HttpHeader.REFERER_LC.equals(name)
|| "accept-encoding".equals(name)
|| HttpHeader.ORIGIN_LC.equals(name)) {
return false;
}
return true;
|| HttpHeader.ORIGIN_LC.equals(name));
}

/**
Expand Down Expand Up @@ -1282,10 +1280,7 @@ static boolean isAuthorizedHeader(final String name) {
if (PROHIBITED_HEADERS_.contains(nameLowerCase)) {
return false;
}
if (nameLowerCase.startsWith("proxy-") || nameLowerCase.startsWith("sec-")) {
return false;
}
return true;
return !nameLowerCase.startsWith("proxy-") && !nameLowerCase.startsWith("sec-");
}

/**
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/org/htmlunit/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @author Ahmed Ashour
* @author Martin Tamme
* @author Ronald Brill
* @author Ashutosh Panda
*/
public final class StringUtils {

Expand Down Expand Up @@ -508,14 +509,7 @@ private static boolean supportedByXML10(final int codepoint) {
return true;
}

if (codepoint < 0x10000) {
return false;
}
if (codepoint <= 0x10FFFF) {
return true;
}

return true;
return codepoint >= 0x10000;
}

/**
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/org/htmlunit/util/geometry/Line2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Simple 2D line segment shape.
*
* @author Ronald Brill
* @author Ashutosh Panda
*/
public class Line2D implements Shape2D {

Expand Down Expand Up @@ -122,12 +123,8 @@ public boolean contains(final double x, final double y) {
}
}

if (y < startY_ && y < endY_
|| (y > startY_ && y > endY_)) {
return false;
}

return true;
return !(y < startY_ && y < endY_
|| (y > startY_ && y > endY_));
}

/**
Expand Down