[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jacorb-bugs
Subject:    [jacorb-bugs] [Bug 608] New:
From:       bugzilla-daemon () inf ! fu-berlin ! de
Date:       2005-06-15 10:12:11
Message-ID: E1DiUsV-0001uI-00 () berners ! inf ! fu-berlin ! de
[Download RAW message or body]

http://www.jacorb.org/cgi-bin/bugzilla/show_bug.cgi?id=608

           Summary: Configuration.loadPropertiesFromClasspath should return
                    null, if configuration is not present in Classpath
           Product: JacORB
           Version: 2.2.2
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: minor
          Priority: P3
         Component: ORB
        AssignedTo: gerald.brose@acm.org
        ReportedBy: rscheel@scoop-gmbh.de
         QAContact: jacorb-bugs@lists.spline.inf.fu-berlin.de


Unlike loadPropertiesFromFile(String) loadPropertiesFromClassPath(String) will 
not return null, if the resource cannot be found. As well, it prints an ugly 
stack trace to System.err.

I propose to change the method as follows:

    private static Properties loadPropertiesFromClassPath(String name)
    {
        Properties result = null;
        try
        {
            java.net.URL url = 
                Thread.currentThread().getContextClassLoader().getResource
(name);
            if (url!=null)           
            {
                result = new Properties();
                result.load( url.openStream() );
            }
        }
        catch (java.io.IOException ioe)
        {
            return null;
        }
        return result;
    }



------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic