geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r425272 - /geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
Date Tue, 25 Jul 2006 04:36:43 GMT
Author: dain
Date: Mon Jul 24 21:36:42 2006
New Revision: 425272

URL: http://svn.apache.org/viewvc?rev=425272&view=rev
Log:
GERONIMO-2145 NPE in Maven1Repository

Modified:
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java?rev=425272&r1=425271&r2=425272&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
Mon Jul 24 21:36:42 2006
@@ -66,16 +66,18 @@
             path = new File(path, query.getType() + "s");
 
             File[] files = path.listFiles();
-            for (int i = 0; i < files.length; i++) {
-                File file = files[i];
-                String fileName = file.getName();
-                if (fileName.startsWith(query.getArtifactId() + "-") && fileName.endsWith("."
+ query.getType())) {
-                    String version = fileName.substring(query.getArtifactId().length() +
1);
-                    version = version.substring(0, version.length() - 1 - query.getType().length());
-                    if(query.getVersion() != null && !query.getVersion().toString().equals(version))
{
-                        continue;
+            if(files != null) {
+                for (int i = 0; i < files.length; i++) {
+                    File file = files[i];
+                    String fileName = file.getName();
+                    if (fileName.startsWith(query.getArtifactId() + "-") && fileName.endsWith("."
+ query.getType())) {
+                        String version = fileName.substring(query.getArtifactId().length()
+ 1);
+                        version = version.substring(0, version.length() - 1 - query.getType().length());
+                        if(query.getVersion() != null && !query.getVersion().toString().equals(version))
{
+                            continue;
+                        }
+                        artifacts.add(new Artifact(query.getGroupId(), query.getArtifactId(),
version, query.getType()));
                     }
-                    artifacts.add(new Artifact(query.getGroupId(), query.getArtifactId(),
version, query.getType()));
                 }
             }
         } else {



Mime
View raw message