LifecycleImpl _firstRequestProcessed should be marked as volatile
-----------------------------------------------------------------

                 Key: MYFACES-2804
                 URL: https://issues.apache.org/jira/browse/MYFACES-2804
             Project: MyFaces Core
          Issue Type: Improvement
          Components: JSR-314
    Affects Versions: 2.0.0
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


Checking how _firstRequestProcessed works, I notice we can do some enhancements 
LifecycleImpl and LifecycleFactoryImpl. In both classes, we use synchronized 
blocks to access common methods, but that is not really necessary, we can do 
other alternatives like ConcurrentHashMap and CopyOnWriteArrayList and they 
will be more effective.

Note LifecycleImpl instance is shared by multiple threads at the same time, so 
it must be thread safe. If we have variables that changes inside it, we must 
ensure visibility adding "final" and "volatile" modifiers too when necessary.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to