package nallar.tickthreading.util.contextaccess;

public class ContextAccessReflection implements ContextAccess {
	@Override
	public Class getContext(int depth) {
		return sun.reflect.Reflection.getCallerClass(depth + 2);
	}

	@Override
	public boolean runningUnder(Class c) {
		for (int i = 0; i < 15; i++) {
			if (getContext(i) == c) {
				return true;
			}
		}
		return false;
	}
}

package nallar.tickthreading.util.contextaccess;

public class ContextAccessReflection implements ContextAccess {
	@Override
	public Class getContext(int depth) {
		return sun.reflect.Reflection.getCallerClass(depth + 2);
	}

	@Override
	public boolean runningUnder(Class c) {
		for (int i = 1; i < 15; i++) {
			if (getContext(i) == c) {
				return true;
			}
		}
		return false;
	}
}

Fix #736