You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2020/01/06 10:43:46 UTC
[cxf] branch master updated: cxf-rt-frontend-jaxrs: fix warning
'boxed variable is never null'
This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 9c48667 cxf-rt-frontend-jaxrs: fix warning 'boxed variable is never null'
9c48667 is described below
commit 9c48667915c34d2e8960d9f11be5b6b7d824ff24
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Mon Jan 6 13:43:04 2020 +0300
cxf-rt-frontend-jaxrs: fix warning 'boxed variable is never null'
---
.../java/org/apache/cxf/jaxrs/provider/ProviderFactory.java | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
index bf7f2b5..b8cadc8 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
@@ -913,21 +913,16 @@ public abstract class ProviderFactory {
}
protected static int compareCustomStatus(ProviderInfo<?> p1, ProviderInfo<?> p2) {
- Boolean custom1 = p1.isCustom();
- Boolean custom2 = p2.isCustom();
- int result = custom1.compareTo(custom2) * -1;
+ boolean custom1 = p1.isCustom();
+ int result = Boolean.compare(p2.isCustom(), custom1);
if (result == 0 && custom1) {
- Boolean busGlobal1 = p1.isBusGlobal();
- Boolean busGlobal2 = p2.isBusGlobal();
- result = busGlobal1.compareTo(busGlobal2);
+ result = Boolean.compare(p1.isBusGlobal(), p2.isBusGlobal());
}
return result;
}
static int comparePriorityStatus(Class<?> cl1, Class<?> cl2) {
- Integer value1 = AnnotationUtils.getBindingPriority(cl1);
- Integer value2 = AnnotationUtils.getBindingPriority(cl2);
- return value1.compareTo(value2);
+ return Integer.compare(AnnotationUtils.getBindingPriority(cl1), AnnotationUtils.getBindingPriority(cl2));
}
private static class ContextResolverComparator