package org.deuce.reflection;

import java.lang.reflect.Field;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.deuce.transform.Exclude;

import sun.misc.Unsafe;

@Exclude
public class UnsafeHolder {

	final private static Logger logger = Logger.getLogger("org.deuce.reflection");

	private static Unsafe unsafe;
	static{
		try{
			Field field = Unsafe.class.getDeclaredField("theUnsafe");
			field.setAccessible(true);
			unsafe = (Unsafe)field.get(null);
		}catch( Exception e){
			logger.log(Level.SEVERE, "Fail to initialize Unsafe.", e);
		}
	}

	public static Unsafe getUnsafe() {
		return unsafe;
	}
}

@@ -319,16 +319,22 @@
 %22);%0D%0A%0D%0A%09
+final 
 private 
@@ -366,16 +366,46 @@
 tatic%7B%0D%0A
+%09%09Unsafe unsafeValue = null;%0D%0A
 %09%09try%7B%0D%0A
@@ -506,16 +506,21 @@
 %09%09unsafe
+Value
  = (Unsa
@@ -633,16 +633,41 @@
 ;%0D%0A%09%09%7D%0D%0A
+%09%09unsafe = unsafeValue;%0D%0A
 %09%7D%0D%0A%0D%0A%09p

Add final to unsafe