camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject Re: Question camel cxf & CXF_MESSAGE
Date Thu, 10 Jan 2013 11:24:06 GMT
Should we raise a ticket to solve this issue ?


On Thu, Jan 10, 2013 at 12:04 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> On Thu, Jan 10, 2013 at 11:54 AM, Babak Vahdat
> <babak.vahdat@swissonline.ch> wrote:
> > Hi
> >
> > Don't know much about CXF itself but this is more than obvious as the
> code
> > (DefaultCxfBinding line 344) is buggy because one can not simply cast an
> > array of *primitive* type ("[B" means array of byte) to Object[] which
> is an
> > array of *reference* type!
> >
> > You would get the same stack trace if you would try to run the crappy
> code
> > below:
> >
> >     public static void main(String[] args) {
> >         byte[] bytes = new byte[] {3, 4};
> >
> >         if (bytes.getClass().isArray()) {
> >             System.out.println("yes it's an array BUT of the primitive
> > type!");
> >             Object array = bytes;
> >             Object[] casted = (Object[]) array; // BOOM
> >         }
> >     }
> >
>
> Yes there is some code in ObjectHelper or one of the helper/util
> classes in the util package
> that can check for array and primitives.
>
> And better yet there is an iterator that can deal with that too.
> So can can more safely grab the data.
>
>
> > Babak
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Question-camel-cxf-CXF-MESSAGE-tp5725227p5725230.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

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