Hej Armin, thank you for your answer.
> I could kick out the log statement if this > solve your problem? That would be an improvement, but not satisfactory: throwing and catching exceptions is costly. A better solution would be an API method or some other defined way to tell whether the proxy wraps a null pointer in order to avoid that case to happen. Maybe this is an issue of the java proxy concept rather than an OJB issue. I am new to proxies, but I wonder what other people do in this case?! Olli > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > > > > >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 (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. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
