[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ClassCastException



hi

does anyone knows something about the following behaviour:

example:

public class CommissionImpl
    extends OzoneObject
    implements Commission
{
    private Number _number = null;

    ...

    public Number getNumber() {
        String name = _number.getName();

        ...

        return _number;
    }
}

public class NumberImpl
    extends OzoneObject
    implements Number
{
    String _name = null;

    ...

    public String getName() {
        return _name;
   }
}

as you see commission and number are ozone objects. if i call the method
getNumber(), i get an ClassCastException inside the CommissionImpl_Proxy
while
trying to return the number (method getNumber()). At that time the
result (inside CommissionImpl_Proxy) contains the string value which was
returned by the getName() method and not the number value which should
be returned by the getNumber() method.

regards
lars