cutting     2004/05/11 10:43:28

  Modified:    src/java/org/apache/lucene/store FSDirectory.java Lock.java
  Log:
  We can just use Lock.toString() to show lock file, no?
  
  Revision  Changes    Path
  1.29      +1 -1      jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java
  
  Index: FSDirectory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- FSDirectory.java  10 May 2004 23:46:56 -0000      1.28
  +++ FSDirectory.java  11 May 2004 17:43:28 -0000      1.29
  @@ -290,7 +290,7 @@
       // create a lock file
       final File lockFile = new File(lockDir, buf.toString());
   
  -    return new Lock(lockFile.getAbsolutePath()) {
  +    return new Lock() {
         public boolean obtain() throws IOException {
           if (DISABLE_LOCKS)
             return true;
  
  
  
  1.12      +2 -14     jakarta-lucene/src/java/org/apache/lucene/store/Lock.java
  
  Index: Lock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/Lock.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Lock.java 10 May 2004 23:46:56 -0000      1.11
  +++ Lock.java 11 May 2004 17:43:28 -0000      1.12
  @@ -35,15 +35,7 @@
    */
   public abstract class Lock {
     public static long LOCK_POLL_INTERVAL = 1000;
  -  private String lockName = null;
  -  
  -  public Lock(String lockName) {
  -    this.lockName = lockName;
  -  }
   
  -  public Lock() {
  -  }
  -  
     /** Attempts to obtain exclusive access and immediately return
      *  upon success or failure.
      * @return true iff exclusive access is obtained
  @@ -63,11 +55,7 @@
       int sleepCount = 0;
       while (!locked) {
         if (++sleepCount == maxSleepCount) {
  -        String s = "Lock obtain timed out";
  -        if (lockName != null) {
  -            s += ", lock name =" + lockName;
  -        }
  -        throw new IOException(s);
  +        throw new IOException("Lock obtain timed out: " + this.toString());
         }
         try {
           Thread.sleep(LOCK_POLL_INTERVAL);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to