This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit fce6e651665ab2ca72c3d9fe2420db2ac14c0d2c Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Nov 13 22:36:56 2019 +0000 Fix SportBugs warnings for Coyote and EL --- .../apache/coyote/http2/Http2UpgradeHandler.java | 12 ----------- java/org/apache/el/util/ReflectionUtil.java | 24 ++++++++++++++++++++++ res/findbugs/filter-false-positives.xml | 18 ++++++++++++++++ 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index 159e5d4..40a379b 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -160,18 +160,6 @@ public class Http2UpgradeHandler extends AbstractStream implements InternalHttpU private volatile int lastWindowUpdate; - /** - * @param adapter The adapter to use to process the upgrade - * @param coyoteRequest The request to use to process the upgrade - * - * @deprecated This will be removed in Tomcat 9 onwards. - * Use {@link #Http2UpgradeHandler(Http2Protocol, Adapter, Request)} - */ - @Deprecated - public Http2UpgradeHandler(Adapter adapter, Request coyoteRequest) { - this(null, adapter, coyoteRequest); - } - public Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request coyoteRequest) { super (STREAM_ID_ZERO); this.protocol = protocol; diff --git a/java/org/apache/el/util/ReflectionUtil.java b/java/org/apache/el/util/ReflectionUtil.java index f59a61c..acf2271 100644 --- a/java/org/apache/el/util/ReflectionUtil.java +++ b/java/org/apache/el/util/ReflectionUtil.java @@ -557,5 +557,29 @@ public class ReflectionUtil { } return cmp; } + + @Override + public boolean equals(Object o) + { + return o == this + || (null != o + && this.getClass().equals(o.getClass()) + && ((MatchResult)o).getExact() == this.getExact() + && ((MatchResult)o).getAssignable() == this.getAssignable() + && ((MatchResult)o).getCoercible() == this.getCoercible() + && ((MatchResult)o).isBridge() == this.isBridge() + ) + ; + } + + @Override + public int hashCode() + { + return (this.isBridge() ? 1 << 24 : 0) + ^ this.getExact() << 16 + ^ this.getAssignable() << 8 + ^ this.getCoercible() + ; + } } } diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml index f8b59f8..eb037f8 100644 --- a/res/findbugs/filter-false-positives.xml +++ b/res/findbugs/filter-false-positives.xml @@ -823,12 +823,30 @@ <Bug pattern="NN_NAKED_NOTIFY" /> </Match> <Match> + <!-- Monitor is used for a single condition. --> + <Class name="org.apache.coyote.http2.WindowAllocationManager" /> + <Method name="notify" /> + <Bug pattern="NO_NOTIFY_NOT_NOTIFYALL" /> + </Match> + <Match> + <!-- Monitor is used for a single condition. --> + <Class name="org.apache.coyote.http2.WindowAllocationManager" /> + <Method name="waitFor" /> + <Bug pattern="WA_NOT_IN_LOOP" /> + </Match> + <Match> <!-- Returning null is required by the EL specification --> <Class name="org.apache.el.lang.ELSupport" /> <Method name="coerceToBoolean"/> <Bug pattern="NP_BOOLEAN_RETURN_NULL"/> </Match> <Match> + <!-- Result is negated because arguments have to be swapped --> + <Class name="org.apache.el.lang.ELSupport" /> + <Method name="compare"/> + <Bug pattern="RV_NEGATING_RESULT_OF_COMPARETO"/> + </Match> + <Match> <!-- JspC will not be used under a security manager --> <Class name="org.apache.jasper.JspC"/> <Method name="initClassLoader"/> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org