Author: kkolinko Date: Mon Jun 23 02:16:14 2014 New Revision: 1604680 URL: http://svn.apache.org/r1604680 Log: Simplify removeWrapper. This backports part of r1604066.
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java?rev=1604680&r1=1604679&r2=1604680&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java Mon Jun 23 02:16:14 2014 @@ -426,33 +426,21 @@ public final class Mapper { * @param contextPath Context path this wrapper belongs to * @param path Wrapper mapping */ - public void removeWrapper - (String hostName, String contextPath, String version, String path) { - Host[] hosts = this.hosts; - int pos = find(hosts, hostName); - if (pos < 0) { + public void removeWrapper(String hostName, String contextPath, + String version, String path) { + Host host = exactFind(hosts, hostName); + if (host == null) { return; } - Host host = hosts[pos]; - if (host.name.equals(hostName)) { - Context[] contexts = host.contextList.contexts; - int pos2 = find(contexts, contextPath); - if (pos2 < 0) { - return; - } - Context context = contexts[pos2]; - if (context.name.equals(contextPath)) { - ContextVersion[] contextVersions = context.versions; - int pos3 = find(contextVersions, version); - if( pos3<0 ) { - return; - } - ContextVersion contextVersion = contextVersions[pos3]; - if (contextVersion.name.equals(version)) { - removeWrapper(contextVersion, path); - } - } + Context context = exactFind(host.contextList.contexts, contextPath); + if (context == null) { + return; + } + ContextVersion contextVersion = exactFind(context.versions, version); + if (contextVersion == null) { + return; } + removeWrapper(contextVersion, path); } protected void removeWrapper(ContextVersion context, String path) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org