Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [PATCH] FileLock.unlock() change, FileLock unit test

eyebrowse
Discussion topic

Back to topic list

[PATCH] FileLock.unlock() change, FileLock unit test

Reply

Author edgar
Full name Edgar Nidome
Date 2002-03-19 17:40:31 PST
Message unlock() no longer raises IllegalStateException when called prior to
calling lock().

Index: FileLock.java
====================​====================​====================​=======
RCS file:
/usr/local/tigris/da​ta/helm/cvs/reposito​ry/eyebrowse/src/jav​a/org/tigris/eyebrow​se/io/FileLock.java,​v

retrieving revision 1.13
diff -u -r1.13 FileLock.java
--- FileLock.java 2002/03/19 21:45:31 1.13
+++ FileLock.java 2002/03/20 00:30:49
@@ -97,20 +97,15 @@
     }

     /**
- * Unlocks the mail repository by removing the lock file. {@link
- * #lock(String, int)} must have been called before this method
- * can be used.
+ * Unlocks the mail repository by removing the lock file.
      */
     public void unlock()
         throws IOException
     {
- if (lockFile == null)
+ if (lockFile != null)
         {
- throw new IllegalStateException
- ("lock() must be called before unlock() can be
called");
+ log.debug("Removing lock file " + lockFilePath);
+ lockFile.delete();
         }
-
- log.debug("Removing lock file " + lockFilePath);
- lockFile.delete();
     }
 }

NEW:
eyebrowse/src/test/o​rg/tigris/eyebrowse/​io
New directory housing unit tests for the io package. Tests that reside
here are automatically compiled and ran with the build's test target.

eyebrowse/src/test/o​rg/tigris/eyebrowse/​io/FileLockTest.java​ :
New basic "sanity" Test for org.tigris.eyebrowse.FileLock.

« Previous message in topic | 1 of 7 | Next message in topic »

Messages

Show all messages in topic

[PATCH] FileLock.unlock() change, FileLock unit test edgar Edgar Nidome 2002-03-19 17:40:31 PST
     Re: [PATCH] FileLock.unlock() change, FileLock unit test dlr Daniel Rall 2002-03-19 18:01:13 PST
     Re: [PATCH] FileLock.unlock() change, FileLock unit test edk Ed Korthof 2002-03-19 18:11:37 PST
         RE: [PATCH] FileLock.unlock() change, FileLock unit test edgar Edgar Nidome 2002-03-20 09:42:08 PST
             Re: [PATCH] FileLock.unlock() change, FileLock unit test edk Ed Korthof 2002-03-20 11:28:15 PST
                 RE: [PATCH] FileLock.unlock() change, FileLock unit test edgar Edgar Nidome 2002-03-20 12:13:09 PST
                     Re: [PATCH] FileLock.unlock() change, FileLock unit test edk Ed Korthof 2002-03-20 13:01:13 PST
Messages per page: