ASF Bugzilla – Attachment 11184 Details for
Bug 28282
Performance problems with ExpressionEvaluatorManager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Remove synchronized from the getEvaluatorByName method
patchfile.txt (text/plain), 1.61 KB, created by
Richard Kraft
on 2004-04-08 14:06:59 UTC
(
hide
)
Description:
Remove synchronized from the getEvaluatorByName method
Filename:
MIME Type:
Creator:
Richard Kraft
Created:
2004-04-08 14:06:59 UTC
Size:
1.61 KB
patch
obsolete
>--- ExpressionEvaluatorManager.java.orig 2004-04-08 03:42:02.000000000 -0500 >+++ ExpressionEvaluatorManager.java 2004-04-08 08:58:40.302582400 -0500 >@@ -99,20 +99,22 @@ > * Gets an ExpressionEvaluator from the cache, or seeds the cache > * if we haven't seen a particular ExpressionEvaluator before. > */ >- public static synchronized >- ExpressionEvaluator getEvaluatorByName(String name) >- throws JspException { >+ public static ExpressionEvaluator getEvaluatorByName(String name) throws JspException >+ { >+ Object oEvaluator = nameMap.get(name); >+ if (oEvaluator != null) >+ return ((ExpressionEvaluator) oEvaluator); > try { >- >- Object oEvaluator = nameMap.get(name); >- if (oEvaluator == null) { >- ExpressionEvaluator e = (ExpressionEvaluator) >- Class.forName(name).newInstance(); >- nameMap.put(name, e); >- return (e); >- } else >+ synchronized (nameMap) >+ { >+ oEvaluator = nameMap.get(name); >+ if (oEvaluator != null) >+ return ((ExpressionEvaluator) oEvaluator); >+ ExpressionEvaluator e = (ExpressionEvaluator) Class.forName(name).newInstance(); >+ nameMap.put(name, e); >+ oEvaluator = e; >+ } > return ((ExpressionEvaluator) oEvaluator); >- > } catch (ClassCastException ex) { > // just to display a better error message > throw new JspException("invalid ExpressionEvaluator: " +
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 28282
: 11184