hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject cvs commit: jakarta-hivemind status.xml
Date Wed, 18 May 2005 21:26:44 GMT
jcarman     2005/05/18 14:26:44

  Modified:    framework/src/java/org/apache/hivemind/util URLResource.java
               .        status.xml
  Log:
  HIVEMIND-122: IBM JDK 1.4.1 and java.net.URL.openStream causes NPE
  
  Revision  Changes    Path
  1.5       +18 -24    jakarta-hivemind/framework/src/java/org/apache/hivemind/util/URLResource.java
  
  Index: URLResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/util/URLResource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- URLResource.java	5 Jan 2005 18:05:01 -0000	1.4
  +++ URLResource.java	18 May 2005 21:26:44 -0000	1.5
  @@ -11,7 +11,6 @@
   // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   // See the License for the specific language governing permissions and
   // limitations under the License.
  -
   package org.apache.hivemind.util;
   
   import java.io.IOException;
  @@ -25,7 +24,7 @@
   
   /**
    * An implementation of {@link org.apache.hivemind.Resource}
  - * built around a string representation of a URL.  
  + * built around a string representation of a URL.
    *
    * @author Howard Lewis Ship
    */
  @@ -33,16 +32,15 @@
   {
       private URL _url;
   
  -    public URLResource(URL url)
  +    public URLResource( URL url )
       {
  -        super(url.toString());
  -
  +        super( url.toString() );
           _url = url;
       }
   
  -    public URLResource(String path)
  +    public URLResource( String path )
       {
  -        super(path);
  +        super( path );
       }
   
       public String toString()
  @@ -50,47 +48,43 @@
           return getPath();
       }
   
  -    protected Resource newResource(String path)
  +    protected Resource newResource( String path )
       {
  -        return new URLResource(path);
  +        return new URLResource( path );
       }
   
       public URL getResourceURL()
       {
  -        if (_url == null)
  +        if( _url == null )
           {
               try
               {
  -                URL test = new URL(getPath());
  -
  +                URL test = new URL( getPath() );
                   InputStream stream = test.openStream();
  -
  -                stream.close();
  -
  -                _url = test;
  +                if( stream != null )
  +                {
  +                    stream.close();
  +                    _url = test;
  +                }
               }
  -            catch (MalformedURLException ex)
  +            catch( MalformedURLException ex )
               {
  -                throw new ApplicationRuntimeException(ex);
  +                throw new ApplicationRuntimeException( ex );
               }
  -            catch (IOException ex)
  +            catch( IOException ex )
               {
                   // If the resource can't be opened,
                   // then return null.
               }
  -
           }
  -
           return _url;
  -
       }
   
       /**
        * Always returns this location; no localization check occurs.
        */
  -    public Resource getLocalization(Locale locale)
  +    public Resource getLocalization( Locale locale )
       {
           return this;
       }
  -
   }
  
  
  
  1.139     +1 -0      jakarta-hivemind/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/status.xml,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- status.xml	16 May 2005 14:51:40 -0000	1.138
  +++ status.xml	18 May 2005 21:26:44 -0000	1.139
  @@ -31,6 +31,7 @@
     </todo>
     <changes>
       <release version="1.1-beta-2" date="unreleased">
  +      <action type="fix" dev="JC" fixes-bug="HIVEMIND-122">IBM JDK 1.4.1 and java.net.URL.openStream
causes NPE"</action>
         <action type="add" dev="JC" due-to="Achim Hügen" fixes-bug="HIVEMIND-107">JMX
Enhancements </action>
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-73" >BuilderFactory attempts
to autowire java.util.List.</action>
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-78" >Certain classloaders (AntClassLoader
for example) cause NullPointerException in impl.MessageFormatter.</action>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message