[ 
https://issues.apache.org/jira/browse/OGNL-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13138544#comment-13138544
 ] 

Maurizio Cucchiara commented on OGNL-31:
----------------------------------------

{quote}
Although harmless, the compiler caching implementation wasn't ideal or 
necessary so I have removed it. The context is only passed to the getCompiler() 
method in order for the OgnlRuntime to perform its class resolving. Once this 
has been achieved the first time the context and class resolving is unnecessary 
on subsequent calls so we can just return the valid _compiler reference that is 
held.
{quote}
I totally agree, the compiler caching implementation was weak: running the 
tests I realized that it cached almost 500 different instances of the 
expression compiler.
I applied your patch, but I have to admit that {{getCompiler}} is not 
thread-safe. 
After some performance tests, it'd seem that synchronization slows down the 
compiler getter (its instantiation doesn't cost so much).  
Hence if sync is not a must in this case, I would keep out of sync this method.

What do you think guys?
                
> [PATCH] Some CPD fixes around ASTMethod and ASTStaticMethod.
> ------------------------------------------------------------
>
>                 Key: OGNL-31
>                 URL: https://issues.apache.org/jira/browse/OGNL-31
>             Project: OGNL
>          Issue Type: Improvement
>            Reporter: Adrian Cumiskey
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>         Attachments: patch-OGNL31-v2.txt, patch-OGNL31.txt
>
>
> I discovered a number of PMD CPD issues around ASTMethod and ASTStaticMethod 
> class, there was quite a bit of duplication there.
> This patch comes courtesy of the wifi connection in my local laundry-mat here 
> in Milwaukee.  Its strange the things people will do to make their clothes 
> wash more quickly :-).
> Cheers, Adrian.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to