felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1064873 - /felix/branches/org.apache.felix.framework-3.0.8-RC/src/main/java/org/apache/felix/framework/cache/BundleCache.java
Date Fri, 28 Jan 2011 20:58:13 GMT
Author: rickhall
Date: Fri Jan 28 20:58:13 2011
New Revision: 1064873

URL: http://svn.apache.org/viewvc?rev=1064873&view=rev
Log:
Port FELIX-2749 from trunk to 3.0.8 branch.

Modified:
    felix/branches/org.apache.felix.framework-3.0.8-RC/src/main/java/org/apache/felix/framework/cache/BundleCache.java

Modified: felix/branches/org.apache.felix.framework-3.0.8-RC/src/main/java/org/apache/felix/framework/cache/BundleCache.java
URL: http://svn.apache.org/viewvc/felix/branches/org.apache.felix.framework-3.0.8-RC/src/main/java/org/apache/felix/framework/cache/BundleCache.java?rev=1064873&r1=1064872&r2=1064873&view=diff
==============================================================================
--- felix/branches/org.apache.felix.framework-3.0.8-RC/src/main/java/org/apache/felix/framework/cache/BundleCache.java
(original)
+++ felix/branches/org.apache.felix.framework-3.0.8-RC/src/main/java/org/apache/felix/framework/cache/BundleCache.java
Fri Jan 28 20:58:13 2011
@@ -87,7 +87,7 @@ public class BundleCache
 
     private final Logger m_logger;
     private final Map m_configMap;
-    private final FileLock m_lock;
+    private final Object m_lock;
 
     public BundleCache(Logger logger, Map configMap)
         throws Exception
@@ -109,8 +109,10 @@ public class BundleCache
         }
 
         Object locking = m_configMap.get(CACHE_LOCKING_PROP);
-        locking = (locking == null) ? "true" : locking.toString();
-        if (Boolean.parseBoolean((String) locking))
+        locking = (locking == null)
+            ? Boolean.TRUE.toString()
+            : locking.toString().toLowerCase();
+        if (((String) locking).equals(Boolean.TRUE.toString()))
         {
             File lockFile = new File(cacheDir, CACHE_LOCK_NAME);
             FileChannel fc = null;
@@ -162,8 +164,8 @@ public class BundleCache
         {
             try
             {
-                m_lock.release();
-                m_lock.channel().close();
+                ((FileLock) m_lock).release();
+                ((FileLock) m_lock).channel().close();
             }
             catch (Exception ex)
             {
@@ -405,4 +407,4 @@ public class BundleCache
 
         return getSecureAction().deleteFile(target);
     }
-}
\ No newline at end of file
+}



Mime
View raw message