Context.java turnOffAuthorisationSystem() can throw a NPE
---------------------------------------------------------

                 Key: DS-209
                 URL: http://jira.dspace.org/jira/browse/DS-209
             Project: DSpace 1.x
          Issue Type: Bug
          Components: DSpace API
    Affects Versions: 1.5.2
            Reporter: Stuart Lewis
             Fix For: 1.6.0
         Attachments: stacktrace-patch.patch

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[3].getClassName();

with

String caller = stackTrace[stackTrace.length - 1].getClassName();


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to