Java tutorial
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Field; import java.lang.reflect.Modifier; public class Main { private static Field getSingletonField(Class<?> hostClas) { Field f = null; try { f = hostClas.getDeclaredField("I"); if (!Modifier.isStatic(f.getModifiers())) throw new Exception("'I' field should be static." + f); f.setAccessible(true); } catch (Throwable ex) { } return f; } }