camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Vahdat <babak.vah...@swissonline.ch>
Subject Re: Question camel cxf & CXF_MESSAGE
Date Thu, 10 Jan 2013 10:54:57 GMT
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
        }
    }
    
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.

Mime
View raw message