ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aealexsandrov <aealexsand...@gmail.com>
Subject Re: ClassCastException in Hibernate QueryCache
Date Wed, 27 Jun 2018 14:52:13 GMT
Hi,

I think that the problem is that next code doesn't work in java:

        public static class SerializableObject implements Serializable {}

and

        Object[] array = new Object[1];

        array[0] = new SerializableObject();

        Serializable[] serializableArr = (Serializable[]) array;

Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object;
cannot be cast to [Ljava.io.Serializable;

But next code works ok:

        SerializableObject[] array = new SerializableObject[1];

        array[0] = new SerializableObject();

        Serializable[] serializableArr = (Serializable[]) array;

BR,
Andrei





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Mime
View raw message