You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/04/12 22:11:40 UTC

DO NOT REPLY [Bug 49102] New: coyote.ajp.Constants - 3 "constant" arrays are mutable

https://issues.apache.org/bugzilla/show_bug.cgi?id=49102

           Summary: coyote.ajp.Constants - 3 "constant" arrays are mutable
           Product: Tomcat 7
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sebb@apache.org


The class coyote.ajp.Constants contains 3 public static non-empty String[]
arrays:

methodTransArray
responseTransArray
headerTransArray

responseTransArray only appears to be locally, so could be made private.

The others are used in index lookups, so get(index) methods could be used to
protect them.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49102] coyote.ajp.Constants - 3 "constant" arrays are mutable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49102

Tim Whittington <ti...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Tim Whittington <ti...@apache.org> 2010-09-23 06:42:29 EDT ---
Fixed in trunk by protecting the lookups with static final getters.
Slowdown is negligible on a micro-benchmark with 1 billion executions, so there
should be no performance hit.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49102] coyote.ajp.Constants - 3 "constant" arrays are mutable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49102

--- Comment #4 from Sebb <se...@apache.org> 2010-09-23 08:08:00 EDT ---
Thanks! Useful to know that the getter method is efficient.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49102] coyote.ajp.Constants - 3 "constant" arrays are mutable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49102

--- Comment #2 from Tim Whittington <ti...@apache.org> 2010-09-22 07:02:17 EDT ---
We can protect these by converting to enums, but the lookup is about 3 times
slower (although .005ns vs 0.014ns is splitting hairs ;).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49102] coyote.ajp.Constants - 3 "constant" arrays are mutable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49102

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5
           Severity|normal                      |enhancement

--- Comment #1 from Mark Thomas <ma...@apache.org> 2010-04-14 18:14:02 EDT ---
Leaning towards WONTFIX.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org