lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r950300 - /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/store/NativeFSLockFactory.java
Date Tue, 01 Jun 2010 23:07:06 GMT
Author: mikemccand
Date: Tue Jun  1 23:07:06 2010
New Revision: 950300

URL: http://svn.apache.org/viewvc?rev=950300&view=rev
Log:
LUCENE-2421: don't use ManagementFactory (not available in 1.4)

Modified:
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/store/NativeFSLockFactory.java

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/store/NativeFSLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/store/NativeFSLockFactory.java?rev=950300&r1=950299&r2=950300&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/store/NativeFSLockFactory.java
(original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/store/NativeFSLockFactory.java
Tue Jun  1 23:07:06 2010
@@ -17,7 +17,6 @@ package org.apache.lucene.store;
  * limitations under the License.
  */
 
-import java.lang.management.ManagementFactory;
 import java.nio.channels.FileChannel;
 import java.nio.channels.FileLock;
 import java.io.File;
@@ -84,10 +83,7 @@ public class NativeFSLockFactory extends
     // our tests). On most systems, the name includes the process Id.
     // Also, remove any non-alphanumeric characters, so that the lock file will
     // be created for sure on all systems.
-    String randomLockName = "lucene-"
-        + ManagementFactory.getRuntimeMXBean().getName().replaceAll("[^a..zA..Z0..9]+","")
+ "-"
-        + Long.toString(new Random().nextInt(), Character.MAX_RADIX)
-        + "-test.lock";
+    String randomLockName = "lucene-" + Long.toString(new Random().nextInt(), Character.MAX_RADIX)
+ "-test.lock";
     
     Lock l = makeLock(randomLockName);
     try {



Mime
View raw message