jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r785597 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory: FSDirectoryManager.java RAMDirectoryManager.java
Date Wed, 17 Jun 2009 13:39:44 GMT
Author: mreutegg
Date: Wed Jun 17 13:39:44 2009
New Revision: 785597

URL: http://svn.apache.org/viewvc?rev=785597&view=rev
Log:
JCR-2087: Upgrade to Java 5 as the base platform

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/RAMDirectoryManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java?rev=785597&r1=785596&r2=785597&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
Wed Jun 17 13:39:44 2009
@@ -90,9 +90,8 @@
             return true;
         }
         // delete files first
-        File[] files = directory.listFiles();
-        for (int i = 0; i < files.length; i++) {
-            if (!files[i].delete()) {
+        for (File file : directory.listFiles()) {
+            if (!file.delete()) {
                 return false;
             }
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/RAMDirectoryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/RAMDirectoryManager.java?rev=785597&r1=785596&r2=785597&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/RAMDirectoryManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/RAMDirectoryManager.java
Wed Jun 17 13:39:44 2009
@@ -33,7 +33,7 @@
     /**
      * Map of directories. Key=String(directory name), Value=Directory.
      */
-    private final Map directories = new HashMap();
+    private final Map<String, Directory> directories = new HashMap<String, Directory>();
 
     /**
      * {@inheritDoc}
@@ -55,7 +55,7 @@
      */
     public Directory getDirectory(String name) {
         synchronized (directories) {
-            Directory dir = (Directory) directories.get(name);
+            Directory dir = directories.get(name);
             if (dir == null) {
                 dir = new RAMDirectory();
                 directories.put(name, dir);
@@ -69,7 +69,7 @@
      */
     public String[] getDirectoryNames() throws IOException {
         synchronized (directories) {
-            return (String[]) directories.keySet().toArray(
+            return directories.keySet().toArray(
                     new String[directories.size()]);
         }
     }
@@ -92,7 +92,7 @@
             if (directories.containsKey(to)) {
                 return false;
             }
-            Directory dir = (Directory) directories.remove(from);
+            Directory dir = directories.remove(from);
             if (dir == null) {
                 return false;
             }



Mime
View raw message