Java synchronization: Synchronization method and synchronization block
===

I have a mulitThread Java application. In one method, there is a need to synchronize a ArrayList. Since arrayList is not a thread safe, so I have to use synchonization. The problem is that object which is type of ArrayList is not a member variable of the object. Prototype of the method is as follows:

    public void simultaneousAccess(ArrayListWrapper aListWrapper){
      ArrayList list = aListWrapper.getList();
      //...Codes manipulate the list            
    }

Due to mulitthreading, shall I use 

A)  

     public void synchronized simultaneousAccess(ArrayListWrapper aListWrapper){
             ArrayList list = aListWrapper.getList();
             //...Codes manipulate the list            
        }
        
Or 

B)

    public void simultaneousAccess(ArrayListWrapper aListWrapper){
         ArrayList list = aListWrapper.getList();
         Synchronized(list){
             //...Codes manipulate the list 
         }           
     }

From the performance test, B) seems work ok. A) always throw exception says ConcurrentModificationException. 

But I donot know why?
