Author: kkolinko
Date: Wed Jul 9 12:28:50 2014
New Revision: 1609130
URL: http://svn.apache.org/r1609130
Log:
Mark MapElement fields as final, for better multithreading behaviour.
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=1609130&r1=1609129&r2=1609130&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
Wed Jul 9 12:28:50 2014
@@ -268,11 +268,9 @@ public final class Mapper {
}
int slashCount = slashCount(path);
synchronized (mappedHost) {
- ContextVersion newContextVersion = new ContextVersion();
+ ContextVersion newContextVersion = new ContextVersion(version,
context);
newContextVersion.path = path;
newContextVersion.slashCount = slashCount;
- newContextVersion.name = version;
- newContextVersion.object = context;
newContextVersion.welcomeResources = welcomeResources;
newContextVersion.resources = resources;
if (wrappers != null) {
@@ -1492,11 +1490,8 @@ public final class Mapper {
protected abstract static class MapElement {
- public String name = null;
- public Object object = null;
-
- public MapElement() {
- }
+ public final String name;
+ public final Object object;
public MapElement(String name, Object object) {
this.name = name;
@@ -1638,6 +1633,13 @@ public final class Mapper {
public Wrapper[] extensionWrappers = new Wrapper[0];
public int nesting = 0;
+ public ContextVersion() {
+ super(null, null);
+ }
+
+ public ContextVersion(String version, Object context) {
+ super(version, context);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]