openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1366665 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: conversation/ConversationImpl.java decorator/DecoratorComparator.java
Date Sat, 28 Jul 2012 13:04:06 GMT
Author: struberg
Date: Sat Jul 28 13:04:05 2012
New Revision: 1366665

URL: http://svn.apache.org/viewvc?rev=1366665&view=rev
Log:
OWB-688 fix non-serializable fields

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1366665&r1=1366664&r2=1366665&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
Sat Jul 28 13:04:05 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.webbeans.conversation;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
 import java.io.Serializable;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -70,16 +72,16 @@ public class ConversationImpl implements
     /**This instance is under used*/
     private AtomicBoolean inUsed = new AtomicBoolean(false);
 
-    private WebBeansContext webBeansContext;
+    private transient WebBeansContext webBeansContext;
 
     /**
-     * Default constructor. Used in tests.
+     * Default constructor. Used for proxies.
      */
     public ConversationImpl()
     {
-        this(WebBeansContext.getInstance());
+        super();
     }
-    
+
     public ConversationImpl(WebBeansContext webBeansContext)
     {
         this.webBeansContext = webBeansContext;
@@ -354,4 +356,13 @@ public class ConversationImpl implements
         return builder.toString();
     }
 
+    /**
+     * We need this for restoring our WebBeansContext on de-serialisation
+     */
+    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
+    {
+        webBeansContext = WebBeansContext.currentInstance();
+        in.defaultReadObject();
+    }
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java?rev=1366665&r1=1366664&r2=1366665&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
Sat Jul 28 13:04:05 2012
@@ -18,14 +18,13 @@
  */
 package org.apache.webbeans.decorator;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import javax.enterprise.inject.spi.Decorator;
 
 import org.apache.webbeans.config.WebBeansContext;
 
-public class DecoratorComparator<T> implements Comparator<Decorator<T>>,
Serializable
+public class DecoratorComparator<T> implements Comparator<Decorator<T>>
 {
 
     /** default serial version UID */



Mime
View raw message