DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16481>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16481

Incorrect usage of context ClassLoader for static field initialization





------- Additional Comments From [EMAIL PROTECTED]  2003-01-28 19:32 -------
Hmmm...I'm just wondering why we need a classloader at all, to load properties 
from a file.  Could we do something like what is in the 
SecuritySupport12.getFileInputStream() class in xml-commons:

    public FileInputStream getFileInputStream(final File file)
        throws FileNotFoundException
    {
        try {
            return (FileInputStream)
                AccessController.doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws FileNotFoundException {
                        return new FileInputStream(file);
                    }
                });
        } catch (PrivilegedActionException e) {
            throw (FileNotFoundException)e.getException();
        }
    }

  and then do:

  FileInputStream fis = ss.getFileInputStream(file1);
  Properties properties;
  properties.load(fis);

???

Of course, with similar code for the case that the JDK is not 1.2 or higher.

Reply via email to