openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r430303 - in /incubator/openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/enhance/PCEnhancer.java java/org/apache/openjpa/kernel/DetachManager.java resources/org/apache/openjpa/enhance/localizer.properties
Date Thu, 10 Aug 2006 08:14:19 GMT
Author: skim
Date: Thu Aug 10 01:14:18 2006
New Revision: 430303

URL: http://svn.apache.org/viewvc?rev=430303&view=rev
Log:
Clean up detach on serialize and ensure declared constructors are properly
public for externalize

Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=430303&r1=430302&r2=430303&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Thu Aug 10 01:14:18 2006
@@ -2892,6 +2892,15 @@
     private void addDetachExternalize(boolean parentDetachable,
         boolean detachedState)
         throws NoSuchMethodException {
+        // ensure that the declared default constructor is public 
+        // for externalization
+        BCMethod meth = _pc.getDeclaredMethod("<init>", (String[]) null);
+        if (!meth.isPublic()) {
+            if (_log.isWarnEnabled())
+                _log.warn(_loc.get("enhance-defcons-extern", 
+                  _meta.getDescribedType()));
+            meth.makePublic();
+        }
         // declare externalizable interface
         if (!Externalizable.class.isAssignableFrom(_meta.getDescribedType()))
             _pc.declareInterface(Externalizable.class);

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java?rev=430303&r1=430302&r2=430303&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
Thu Aug 10 01:14:18 2006
@@ -89,9 +89,9 @@
         if (setState) {
             sm.getPersistenceCapable().pcSetDetachedState(getDetachedState
                 (sm, idxs));
-            return true;
+            return false; // don't null state
         }
-        return false;
+        return true;
     }
 
     /**

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties?rev=430303&r1=430302&r2=430303&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties
Thu Aug 10 01:14:18 2006
@@ -44,6 +44,8 @@
 	class that implements java.io.Serializable. If compatibility with \
 	non-enhanced versions of "{0}" is not needed, this warning can be ignored.
 enhance-oid: Enhancing object id type "{0}" to allow member access. 
+enhance-defcons-extern: Type "{0}" requires a public constructor to support \
+    detach on serialize.  Making default constructor public.
 cons-access: An error occurred trying to instantiate a custom storage class.
 pcdata-generate: Generating dynamic PCData for type: "{0}"
 pcdata-created: Dynamic PCData created: name="{0}", for type="{1}"



Mime
View raw message