Author: rmannibucau
Date: Tue Aug 23 14:08:20 2011
New Revision: 1160702

URL: http://svn.apache.org/viewvc?rev=1160702&view=rev
Log:
reverting modulename for persistence

Modified:
    
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java

Modified: 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1160702&r1=1160701&r2=1160702&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
 Tue Aug 23 14:08:20 2011
@@ -101,20 +101,13 @@ public class ReadDescriptors implements 
         List<URL> persistenceUrls = (List<URL>) 
appModule.getAltDDs().get("persistence.xml");
         if (persistenceUrls != null) {
             for (URL persistenceUrl : persistenceUrls) {
-                String moduleName = "";
-                String path;
-                if (!persistenceUrl.toString().contains("!")) {
-                    File file = URLs.toFile(persistenceUrl);
-                    path = file.getAbsolutePath();
+                File file = URLs.toFile(persistenceUrl);
+                String path = file.getAbsolutePath();
 
-                    if (file.getName().endsWith("persistence.xml")) {
-                        file = file.getParentFile().getParentFile();
-                    }
-                    moduleName = file.toURI().toString();
-                } else {
-                    moduleName = 
persistenceUrl.toString().replace("META-INF/persistence.xml", "");
-                    path = persistenceUrl.toString();
+                if (file.getName().endsWith("persistence.xml")) {
+                    file = file.getParentFile().getParentFile();
                 }
+                String  moduleName = file.toURI().toString();
 
                 try {
                     Persistence persistence = 
JaxbPersistenceFactory.getPersistence(persistenceUrl);


Reply via email to