Skip to content

Commit

Permalink
Fix SpotBugs casting warning.
Browse files Browse the repository at this point in the history
Simplify by casting directing to ServiceRef given that an 'instance of' test immediately precedes the first cast.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1818014 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Dec 13, 2017
1 parent 59fbdca commit 6368b62
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -33,7 +33,6 @@
import javax.naming.Name; import javax.naming.Name;
import javax.naming.NamingException; import javax.naming.NamingException;
import javax.naming.RefAddr; import javax.naming.RefAddr;
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory; import javax.naming.spi.ObjectFactory;
import javax.wsdl.Definition; import javax.wsdl.Definition;
import javax.wsdl.Port; import javax.wsdl.Port;
Expand Down Expand Up @@ -70,7 +69,7 @@ public Object getObjectInstance(Object obj, Name name, Context nameCtx,
throws Exception { throws Exception {


if (obj instanceof ServiceRef) { if (obj instanceof ServiceRef) {
Reference ref = (Reference) obj; ServiceRef ref = (ServiceRef) obj;


// ClassLoader // ClassLoader
ClassLoader tcl = ClassLoader tcl =
Expand Down Expand Up @@ -236,13 +235,13 @@ public Object getObjectInstance(Object obj, Name name, Context nameCtx,
} }


// Use handler // Use handler
if (((ServiceRef) ref).getHandlersSize() > 0) { if (ref.getHandlersSize() > 0) {


HandlerRegistry handlerRegistry = service.getHandlerRegistry(); HandlerRegistry handlerRegistry = service.getHandlerRegistry();
List<String> soaproles = new ArrayList<>(); List<String> soaproles = new ArrayList<>();


while (((ServiceRef) ref).getHandlersSize() > 0) { while (ref.getHandlersSize() > 0) {
HandlerRef handlerRef = ((ServiceRef) ref).getHandler(); HandlerRef handlerRef = ref.getHandler();
HandlerInfo handlerInfo = new HandlerInfo(); HandlerInfo handlerInfo = new HandlerInfo();


// Loading handler Class // Loading handler Class
Expand Down

0 comments on commit 6368b62

Please sign in to comment.