commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trei...@apache.org
Subject cvs commit: jakarta-commons-sandbox/id/src/java/org/apache/commons/id/uuid/state ReadWriteFileStateImpl.java
Date Mon, 31 May 2004 07:00:12 GMT
treilly     2004/05/31 00:00:12

  Modified:    id/src/java/org/apache/commons/id/uuid/state
                        ReadWriteFileStateImpl.java
  Log:
  try..catch same line, IOException compat for jdk1.5
  
  Revision  Changes    Path
  1.4       +8 -12     jakarta-commons-sandbox/id/src/java/org/apache/commons/id/uuid/state/ReadWriteFileStateImpl.java
  
  Index: ReadWriteFileStateImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/id/src/java/org/apache/commons/id/uuid/state/ReadWriteFileStateImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReadWriteFileStateImpl.java	28 Apr 2004 03:05:43 -0000	1.3
  +++ ReadWriteFileStateImpl.java	31 May 2004 07:00:12 -0000	1.4
  @@ -39,7 +39,7 @@
        *
        * @see org.apache.commons.id.uuid.state.State#store(java.util.Collection)
        */
  -    public void store(Set nodes) {
  +    public void store(Set nodes) throws IOException {
           writeXML(genXML(nodes));
       }
   
  @@ -49,7 +49,7 @@
        * @param nodes the Set to create xml for.
        * @return an XML string of the node Set.
        */
  -    private String genXML(Set nodes) {
  +    private String genXML(Set nodes) throws IOException {
           Iterator it = nodes.iterator();
           StringBuffer buf = new StringBuffer(1024);
           buf.append(StateHelper.XML_DOC_START);
  @@ -76,7 +76,7 @@
        * @param timestamp the timestamp to write for all nodes.
        * @return an XML string of the node Set.
        */
  -    private String genXML(Set nodes, long timestamp) {
  +    private String genXML(Set nodes, long timestamp)  throws IOException {
           Iterator it = nodes.iterator();
           StringBuffer buf = new StringBuffer(1024);
           buf.append(StateHelper.XML_DOC_START);
  @@ -105,8 +105,7 @@
           String resourceName = System.getProperty(CONFIG_FILENAME_KEY);
           if (resourceName == null) {
               return;
  -        }
  -        else {
  +        } else {
               URL rUrl = ClassLoader.getSystemResource(resourceName);
               if (rUrl != null) {
                   File file = new File(rUrl.getFile());
  @@ -116,15 +115,12 @@
                           fw = new FileWriter(file);
                           fw.write(xml);
                           fw.close();
  -                    }
  -                    catch (IOException ioe) {
  +                    } catch (IOException ioe) {
                           //@TODO log it?
  -                    }
  -                    finally {
  +                    } finally {
                           try {
                               fw.close();
  -                        }
  -                        catch (IOException ioee) {
  +                        } catch (IOException ioee) {
                               ; //Nothing to do.
                           }
                           fw = null;
  
  
  

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


Mime
View raw message