dev@grizzly.java.net

Re: A NullPointerException in DataHandler

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 01 May 2008 17:06:19 -0400

Salut,

applied.

Thanks!

-- Jeanfrancois

Shing-Wai.Chan_at_Sun.COM wrote:
> Hi,
> I just see a NullPointerException in DataHandler.java.
>
> The following is my proposal fix:
> /export/grizzly/src/trunk/modules/cometd/src/main/java/com/sun/grizzly/cometd
> > svn diff DataHandler.java
> Index: DataHandler.java
> ===================================================================
> --- DataHandler.java (revision 1115)
> +++ DataHandler.java (working copy)
> @@ -82,7 +82,10 @@
> try{ if (obj instanceof
> DeliverResponse){
> DeliverResponse deliverRes = (DeliverResponse)obj;
> - if (deliverRes.getClientId().equals(getClientId())){
> + String deliverResClientId = deliverRes.getClientId();
> + if ((deliverResClientId != null &&
> + deliverResClientId.equals(getClientId()) ||
> + deliverResClientId == null && getClientId() ==
> null)) {
> return;
> }
> res.write(deliverRes.toJSON());
>
> Regards,
> Shing Wai Chan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>