In Context.java, when the methods turnOffAuthorisationSystem() or restoreAuthSystemState() are called, the calling class name is recorded. However the calling class is hardcoded to be the 4th item in stack. The calling class will not always be in the 4th position in the stack.
For example when using this method in a CLI application, it could be the 2nd item in the stack, the first being java.Thread.
Patch attached which replaces the hardcoded:
String caller = stackTrace.getClassName();
String caller = stackTrace[stackTrace.length - 1].getClassName();