harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy,Jing Lv" <firep...@gmail.com>
Subject Re: [luni] ObjectInputStream.java
Date Wed, 11 Aug 2010 14:46:18 GMT
Thanks Matthias, a lesson to me ;)

2010/8/11 Matthias Wessendorf <matzew@apache.org>

> a little background.
>
> I am working on an Apache MyFaces project, were we have our own
> ObjectInputStream class ([1]).
> Now when we update to the latest version of one of our dependencies
> (JSF 2.0, Sun Mojarra), we
> got this exception:
> java.lang.ClassNotFoundException: void
> ...
>
> I filed a bug against them, b/c of that (see [2] for more). They said
> the reason why we see it is that with the new version one of their
> helper class stores null values as
> Void.TYPE(s). Therefore they suggested to do what the JDK does.
>
> The did a very simple patch ([3]), which I think is code from the Sun
> JDK 1.6.x of the "standard" ObjectInputStream.
> In order to avoid any license issues, by looking into Sun's JDK, I
> opened Harmony can "borrowed" code.
>
> So I am wondering if the void has been forgotten..., since I suspect
> (as of [3]) that the Sun JDK's ObjectInputStream does
> register void/void.class....
>
> BTW. I changed our custom ObjectInputStream patch (see [4]) and the
> error (java.lang.ClassNotFoundException: void) is now gone
>
> Greetings,
> Matthias
>
> [1]
> https://issues.apache.org/jira/secure/attachment/12439193/1.2.12.2_compressviewstate.patch
> [2] https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1607
> [3]
> https://javaserverfaces.dev.java.net/nonav/issues/showattachment.cgi/1241/1607.txt
> [4]
> https://issues.apache.org/jira/secure/attachment/12451648/TRINIDAD-1747_August10.patch
>
>
> On Wed, Aug 11, 2010 at 10:21 AM, Jimmy,Jing Lv <firepure@gmail.com>
> wrote:
> > Hi Matthias,
> >
> >     I suppose ObjectInputStream is mainly use to serialize Object but
> void
> > is not a kind of Class to be serialized. Please tell me if I am wrong.
> >
> > 2010/8/10 Mark Hindess <mark.hindess@googlemail.com>
> >
> >>
> >> In message <AANLkTinN_KKS+RkLZfXup2tGHBAoR-9FVB8om3MCi9u=@
> mail.gmail.com>,
> >> Matthias Wessendorf writes:
> >> >
> >> > Hello,
> >> >
> >> > looking at ObjectInputStream.java,
> >> >
> >> >     static {
> >> >         PRIMITIVE_CLASSES.put("byte", byte.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("short", short.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("int", int.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("long", long.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("boolean", boolean.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("char", char.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("float", float.class); //$NON-NLS-1$
> >> >         PRIMITIVE_CLASSES.put("double", double.class); //$NON-NLS-1$
> >> >     }
> >> >
> >> > I am wondering why there is no "void", void.class key-value pair?
> >>
> >> I see you've raised a JIRA bug for this.  I'm struggling to understand
> >> in what context this would be needed.  Can you provide a test case that
> >> shows why it is needed?
> >>
> >> Regards,
> >>  Mark.
> >>
> >>
> >>
> >
> >
> > --
> >
> > Best Regards!
> >
> > Jimmy, Jing Lv
> >
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>



-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message