Hello,

> I am still wondering how to use proxies appropriately.
> Someone else must have done this before.

I seem to be the only one interested in this,
but nevertheless I would like to say that I found 
another problem.  see below.

> 
> > -----Original Message-----

> > >In short: Is is intended that a null-reference
> > >is wrapped by a proxy?

> Suppose I want to output a.b.getMsg() 
> if and only if a.b != null.
> 
> If b is not proxied, I simply write
> 
> if (a.b!=null)
>       System.out.println(a.b.getMsg())
> 
> If b is proxied, however, the above will throw
> a NullPointerException.  So, what's the solution?
> (An unacceptable solution would be to allow that exception
> to be thrown and then catch and ignore it.)

That solution (catching the NullPointerException) 
does not work nicely, either, because the 
IndirectionHandler logs the stackdump as an error
before it re-throws it.

Why?

Olli


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to