openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpala...@apache.org
Subject svn commit: r954979 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestCacheMarshaller.java
Date Tue, 15 Jun 2010 17:47:03 GMT
Author: rpalache
Date: Tue Jun 15 17:47:02 2010
New Revision: 954979

URL: http://svn.apache.org/viewvc?rev=954979&view=rev
Log:
OPENJPA-1695 OutOfMemoryError from CacheMarshallerImpl.setInputUrlFromResourceLocation

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestCacheMarshaller.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java?rev=954979&r1=954978&r2=954979&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
Tue Jun 15 17:47:02 2010
@@ -223,7 +223,7 @@ public class CacheMarshallerImpl
             List list = new ArrayList();
             for (Enumeration e = cl.getResources(_inputResourceLocation);
                 e.hasMoreElements(); )
-                list.add(e);
+                list.add(e.nextElement());
 
             if (list.size() > 1) {
                 if (_consumeErrors) {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestCacheMarshaller.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestCacheMarshaller.java?rev=954979&r1=954978&r2=954979&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestCacheMarshaller.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestCacheMarshaller.java
Tue Jun 15 17:47:02 2010
@@ -31,8 +31,9 @@ public class TestCacheMarshaller
             "default(Id=" + getClass().getName() + ", ValidationPolicy="
                 + OpenJPAVersionAndConfigurationTypeValidationPolicy.class
                     .getName()
-                + ", InputURL=file:target/" + getClass().getName() + ".ser"
-                + ", OutputFile=target/"
+                + ", InputURL=file:target/test-classes/" 
+                + getClass().getName() + ".ser"
+                + ", OutputFile=target/test-classes/"
                 + getClass().getName() + ".ser)"
         });
         emf.createEntityManager().close();
@@ -67,4 +68,11 @@ public class TestCacheMarshaller
         cm.store(o);
         assertEquals(o, cm.load());
     }
+    
+    public void testendConfiguration() {
+        ((CacheMarshallerImpl)cm).setInputURL(null);
+        ((CacheMarshallerImpl)cm)
+            .setInputResource(getClass().getName() + ".ser");
+        ((CacheMarshallerImpl)cm).endConfiguration();
+    }
 }



Mime
View raw message