You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2007/12/17 10:06:20 UTC

svn commit: r604800 - in /geronimo/server/trunk: framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/ plugins/j2ee/geronimo-j2ee-bui...

Author: djencks
Date: Mon Dec 17 01:06:18 2007
New Revision: 604800

URL: http://svn.apache.org/viewvc?rev=604800&view=rev
Log:
GERONIMO-3710 fix CCE through the miracle of generics and a bit of cleanup

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=604800&r1=604799&r2=604800&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java Mon Dec 17 01:06:18 2007
@@ -538,7 +538,7 @@
         additionalDeployment.add(configurationData);
     }
 
-    public List getAdditionalDeployment() {
+    public List<ConfigurationData> getAdditionalDeployment() {
         return additionalDeployment;
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java?rev=604800&r1=604799&r2=604800&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java Mon Dec 17 01:06:18 2007
@@ -28,10 +28,10 @@
 import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
-import java.util.LinkedList;
 import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
@@ -82,7 +82,7 @@
 
     public static void copyFile(File source, File destination) throws IOException {
         File destinationDir = destination.getParentFile();
-        if (false == destinationDir.exists() && false == destinationDir.mkdirs()) {
+        if (!destinationDir.exists() && !destinationDir.mkdirs()) {
             throw new java.io.IOException("Cannot create directory : " + destinationDir);
         }
         
@@ -300,7 +300,7 @@
     }
     
     
-    public static boolean recursiveDelete(File root, Collection unableToDeleteCollection) {
+    public static boolean recursiveDelete(File root, Collection<String> unableToDeleteCollection) {
         if (root == null) {
             return true;
         }
@@ -318,37 +318,36 @@
                         }
                     }
                     // help out the GC of file handles by nulling the references
-                    file = null;
                     files[i] = null;
                 }
             }
         }
-        boolean rootDeleteStatus = false;
+        boolean rootDeleteStatus;
         if (!(rootDeleteStatus = root.delete()) && unableToDeleteCollection != null) 
-        	unableToDeleteCollection.add(root);
+        	unableToDeleteCollection.add(root.getAbsolutePath());
         
         return rootDeleteStatus;
     }
     
     public static boolean recursiveDelete(File root) {
-        return recursiveDelete(root,null);
+        return recursiveDelete(root, null);
     }
 
-    public static Collection listRecursiveFiles(File file) {
-        LinkedList list = new LinkedList();
+    public static Collection<File> listRecursiveFiles(File file) {
+        Collection<File> list = new ArrayList<File>();
         listRecursiveFiles(file, list);
         return Collections.unmodifiableCollection(list);
     }
 
-    public static void listRecursiveFiles(File file, Collection collection) {
+    public static void listRecursiveFiles(File file, Collection<File> collection) {
         File[] files = file.listFiles();
         if ( null == files ) {
             return;
         }
-        for (int i = 0; i < files.length; i++) {
-            collection.add(files[i]);
-            if (files[i].isDirectory()) {
-                listRecursiveFiles(files[i], collection);
+        for (File file1 : files) {
+            collection.add(file1);
+            if (file1.isDirectory()) {
+                listRecursiveFiles(file1, collection);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=604800&r1=604799&r2=604800&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Mon Dec 17 01:06:18 2007
@@ -999,10 +999,7 @@
 
     private boolean isLibraryEntry(ApplicationType application, ZipEntry entry) {
         String libDir = getLibraryDirectory(application);
-        if (libDir != null && entry.getName().startsWith(libDir)) {
-            return true;
-        }
-        return false;
+        return libDir != null && entry.getName().startsWith(libDir);
     }
 
     private void mapVendorPlans(GerApplicationType gerApplication, Map<String, Object> altVendorDDs, JarFile earFile) throws DeploymentException {