openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r540283 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
Date Mon, 21 May 2007 20:45:10 GMT
Author: mprudhom
Date: Mon May 21 13:45:09 2007
New Revision: 540283

URL: http://svn.apache.org/viewvc?view=rev&rev=540283
Log:
OPENJPA-148 Applied follow-up patch that resolved potential NPEs

Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java?view=diff&rev=540283&r1=540282&r2=540283
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
Mon May 21 13:45:09 2007
@@ -46,6 +46,7 @@
 import org.apache.openjpa.lib.meta.URLMetaDataIterator;
 import org.apache.openjpa.lib.meta.ZipFileMetaDataIterator;
 import org.apache.openjpa.lib.meta.ZipStreamMetaDataIterator;
+import org.apache.openjpa.lib.meta.ClassLoaderMetaDataIterator;
 import org.apache.openjpa.lib.util.Files;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.util.GeneralException;
@@ -633,13 +634,18 @@
         if (urls != null) {
             for (Iterator itr = urls.iterator(); itr.hasNext();) {
                 url = (URL) itr.next();
-
                 if ("file".equals(url.getProtocol())) {
                     File file = new File(url.getFile()).getAbsoluteFile();
-                    if (files.contains(file)) {
+                    if (files != null && files.contains(file)) {
+                        continue;
+                    } else if (file.isDirectory()) {
+                        if (log.isTraceEnabled())
+                            log.trace(_loc.get("scanning-directory", file));
+                        scan(new FileMetaDataIterator(file, newMetaDataFilter()),
+                                cparser, names, true, file);
                         continue;
                     }
-                } 
+                }
                 if ("jar".equals(url.getProtocol())
                     && url.getPath().endsWith("!/")) {
                     if (log.isTraceEnabled())



Mime
View raw message