Ops, pressed SEND to quickly...

On 09/04/2017 10:45 AM, Peter Levart wrote:


     ClassDataSlot[] getClassDataLayout() throws InvalidClassException {
         ClassDataSlot[] slots = dataLayout;
         if (slots == null) {
             ClassDataSlot[] slots = getClassDataLayout0();
             VarHandle.fullFence();
             dataLayout = slots;
         }
         return slots;
     }



Correct code (forgot to remove the 2nd declaration of local field):

     ClassDataSlot[] getClassDataLayout() throws InvalidClassException {
         ClassDataSlot[] slots = dataLayout;
         if (slots == null) {
             slots = getClassDataLayout0();
             VarHandle.fullFence();
             dataLayout = slots;
         }
         return slots;
     }


Peter

Reply via email to