openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1590649 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event: EventImpl.java EventMetadataImpl.java
Date Mon, 28 Apr 2014 14:19:08 GMT
Author: arne
Date: Mon Apr 28 14:19:07 2014
New Revision: 1590649

URL: http://svn.apache.org/r1590649
Log:
OWB-815: Fixed serialization of EventImpl

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventMetadataImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java?rev=1590649&r1=1590648&r2=1590649&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
Mon Apr 28 14:19:07 2014
@@ -19,8 +19,6 @@
 package org.apache.webbeans.event;
 
 import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.util.Set;
@@ -31,8 +29,6 @@ import javax.enterprise.util.TypeLiteral
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.util.Asserts;
-import org.apache.webbeans.util.OwbCustomObjectInputStream;
-import org.apache.webbeans.util.WebBeansUtil;
 
 /**
  * Event implementation.
@@ -42,8 +38,8 @@ import org.apache.webbeans.util.WebBeans
  */
 public class EventImpl<T> implements Event<T>, Serializable
 {
-    private static final long serialVersionUID = -9035218380365451350L;
-    
+    private static final long serialVersionUID = 393021493190378023L;
+
     private EventMetadataImpl metadata;
 
     private transient WebBeansContext webBeansContext;
@@ -112,19 +108,9 @@ public class EventImpl<T> implements Eve
         return new EventImpl<U>(metadata.select(subtype, bindings), webBeansContext);
     }
     
-    private void writeObject(java.io.ObjectOutputStream op) throws IOException
-    {
-        ObjectOutputStream oos = new ObjectOutputStream(op);
-        oos.writeObject(metadata);
-        
-        oos.flush();
-    }
-    
     private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
     {
-        final ObjectInputStream inputStream = new OwbCustomObjectInputStream(in, WebBeansUtil.getCurrentClassLoader());
-        metadata = (EventMetadataImpl)inputStream.readObject();
-
+        in.defaultReadObject();
         webBeansContext = WebBeansContext.currentInstance();
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventMetadataImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventMetadataImpl.java?rev=1590649&r1=1590648&r2=1590649&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventMetadataImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventMetadataImpl.java
Mon Apr 28 14:19:07 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.webbeans.event;
 
+import java.io.IOException;
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -38,11 +39,12 @@ import org.apache.webbeans.util.Generics
 
 public class EventMetadataImpl implements EventMetadata, Serializable
 {
-
+    private static final long serialVersionUID = -6401875861180683988L;
+ 
     private final Type type;
     private final InjectionPoint injectionPoint;
     private final Set<Annotation> qualifiers;
-    private final WebBeansContext context;
+    private transient WebBeansContext webBeansContext;
     
     public EventMetadataImpl(Type type, InjectionPoint injectionPoint, Annotation[] qualifiers,
WebBeansContext context)
     {
@@ -53,7 +55,7 @@ public class EventMetadataImpl implement
         context.getAnnotationManager().checkQualifierConditions(qualifiers);
         this.type = type;
         this.injectionPoint = injectionPoint;
-        this.context = context;
+        this.webBeansContext = context;
         Set<Annotation> completeQualifiers;
         if (qualifiers.length == 0)
         {
@@ -110,6 +112,12 @@ public class EventMetadataImpl implement
         {
             throw new IllegalArgumentException("duplicate qualifier");
         }
-        return new EventMetadataImpl(subtype, injectionPoint, newQualifiers.toArray(new Annotation[newQualifiers.size()]),
context);
+        return new EventMetadataImpl(subtype, injectionPoint, newQualifiers.toArray(new Annotation[newQualifiers.size()]),
webBeansContext);
+    }
+    
+    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
+    {
+        in.defaultReadObject();
+        webBeansContext = WebBeansContext.currentInstance();
     }
 }



Mime
View raw message