sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1480699 - /sis/branches/Android/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java
Date Thu, 09 May 2013 15:52:12 GMT
Author: desruisseaux
Date: Thu May  9 15:52:12 2013
New Revision: 1480699

URL: http://svn.apache.org/r1480699
Log:
Avoir a NullPointerException.

Modified:
    sis/branches/Android/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java

Modified: sis/branches/Android/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java?rev=1480699&r1=1480698&r2=1480699&view=diff
==============================================================================
--- sis/branches/Android/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java
[UTF-8] (original)
+++ sis/branches/Android/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java
[UTF-8] Thu May  9 15:52:12 2013
@@ -92,15 +92,18 @@ public class ResourceCompilerMojo extend
      */
     private int processAllResourceDirectories(final File directory) throws ResourceCompilerException
{
         int errors = 0;
-        for (final File subdir : directory.listFiles()) {
-            if (subdir.isDirectory()) {
-                if (subdir.getName().equals("resources")) {
-                    final File[] resourcesToProcess = subdir.listFiles(this);
-                    if (resourcesToProcess != null && resourcesToProcess.length !=
0) {
-                        errors += new Compiler(resourcesToProcess).run();
+        final File[] subdirs = directory.listFiles();
+        if (subdirs != null) { // Appears to be sometime null with auto-generated sub-directories.
+            for (final File subdir : subdirs) {
+                if (subdir.isDirectory()) {
+                    if (subdir.getName().equals("resources")) {
+                        final File[] resourcesToProcess = subdir.listFiles(this);
+                        if (resourcesToProcess != null && resourcesToProcess.length
!= 0) {
+                            errors += new Compiler(resourcesToProcess).run();
+                        }
+                    } else {
+                        errors += processAllResourceDirectories(subdir);
                     }
-                } else {
-                    errors += processAllResourceDirectories(subdir);
                 }
             }
         }



Mime
View raw message