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

Re: ClassCastException



> I tried to test this by changing org.ozoneDB.test.simpleAutoImpl to:
>
> public class AutoImpl extends OzoneObject implements Auto {
>
>    Auto         link;
>    ...
>
>    public Auto doSomthing (Auto auto) throws Exception {
>       String linkName = link.name();
>       System.out.println ("doSomething(): linkName=" + linkName);
>       return link;
>       }
>    ...
> }
>
> doSomthing() now does the same as CommisionImpl.getNumber(). Right?
>

yes, that's right ...

>
> But calling doSomething() in my test case returns exactly the expected results
> - no exceptions.
>
> The result field is a _local_ variable of all proxy methods. OPP produces the
> following code for the doSomething() method of the proxy:
>
> public org.ozoneDB.test.simple.Auto doSomthing (org.ozoneDB.test.simple.Auto
>              arg0) throws java.lang.Exception {
>
>       try {
>          Object target = link.fetch (this, Lock.LEVEL_READ);
>          if (target != null) {
>             arg0 = (org.ozoneDB.test.simple.Auto)ResultConverter.substituteOzoneCompatibles (arg0);
>             return (org.ozoneDB.test.simple.Auto)ResultConverter.substituteOzoneCompatibles (((org.ozoneDB.test.simple.AutoImpl)target).doSomthing(arg0));
>             }
>          else {
>             Object[] args = {arg0};
>             Object result = link.invoke (this, 4, args, Lock.LEVEL_READ);
>             return (org.ozoneDB.test.simple.Auto)result;
>             }
>          }
>       catch (java.lang.Exception e) {
>          e.fillInStackTrace();
>          throw e;
>          }
>       }
>
> So, subsequent calls fo the same or different methods of the proxy cannot
> affect each other.
>
> Are you on windows? If yes, can you test on Linux?

no, i have only a windows box ...

but on the basis of your response i tested it with references to a number of other ozone objects ... sometimes the expected result will be returned sometimes
not ... i will check the differences and if i get some news you will hear it ...

thanx & regards
lars