Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aperi-dev] ClassCastException


I noted that sometimes when getting the attributes from the Device Server a ClassCastException appears.

This seems to have generated the 170151 bug (No Managed-disks showed up in Create Virtual Disks).

I think it is safer to cast to a Number when using the GUIEntityUtil.getNumberValuemethod:

        short nativeStatus = GUIEntityUtil.getNumberValue((ShortNumber) attr
                .get(TResStorageExtentTable.NATIVE_STATUS)).shortValue();

because we can't be sure if the HashMap contains a short or an integer.

The value can be stored into a short because the DB type for NATIVE_STATUS is smallint, but in some places it was recorded in the HashMap as an integer.

Regards,
Rodica

Back to the top