You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ted Steen <te...@gmail.com> on 2006/05/29 19:44:49 UTC

Tapernate/squeezer chain - squeezing null bug

When squeezing an object that is null,
EntitySqueezerFilter.squeeze(EntitySqueezerFilter.java:57) throws NPE.
It doesn't matter if it is an entity or not, because the object is
passed through the chain, and eventually ends up in the
EntitySqueezerFilter.

A solution to this problem would be to either check for null in the
squeeze method, or maybe let some kind of "null squeezer" (that
squeezes the object to a single character, like X)  be the first
DataSqueezerFilter in the chain.

If the new squeezing chain is going into the Tapestry 4.1 API, maybe
placing the "null squeezer" first in the chain would be a good idea as
it eliminates the danger of getting NPEs in other, potentially buggy
3rd party squeezers implementations.

ted

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Tapernate/squeezer chain - squeezing null bug

Posted by James Carman <ja...@carmanconsulting.com>.
Ok, I put in a test case that illustrates the problem and I fixed it.  I'm
still thinking about that null check thingy and I think it's a good idea.

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Monday, May 29, 2006 5:43 PM
To: 'Tapestry users'
Subject: RE: Tapernate/squeezer chain - squeezing null bug

Ted,

Great catch!  For now, I'll just put in a null check in the Tapernate
squeezer.  

Thanks,

James

-----Original Message-----
From: Ted Steen [mailto:ted.steen@gmail.com] 
Sent: Monday, May 29, 2006 1:56 PM
To: Tapestry users
Subject: Re: Tapernate/squeezer chain - squeezing null bug

Here's the stack trace if anyone is interested;
http://paste.uni.cc/9180

2006/5/29, Ted Steen <te...@gmail.com>:
> When squeezing an object that is null,
> EntitySqueezerFilter.squeeze(EntitySqueezerFilter.java:57) throws NPE.
> It doesn't matter if it is an entity or not, because the object is
> passed through the chain, and eventually ends up in the
> EntitySqueezerFilter.
>
> A solution to this problem would be to either check for null in the
> squeeze method, or maybe let some kind of "null squeezer" (that
> squeezes the object to a single character, like X)  be the first
> DataSqueezerFilter in the chain.
>
> If the new squeezing chain is going into the Tapestry 4.1 API, maybe
> placing the "null squeezer" first in the chain would be a good idea as
> it eliminates the danger of getting NPEs in other, potentially buggy
> 3rd party squeezers implementations.
>
> ted
>


-- 
ted

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Tapernate/squeezer chain - squeezing null bug

Posted by James Carman <ja...@carmanconsulting.com>.
Ted,

Great catch!  For now, I'll just put in a null check in the Tapernate
squeezer.  

Thanks,

James

-----Original Message-----
From: Ted Steen [mailto:ted.steen@gmail.com] 
Sent: Monday, May 29, 2006 1:56 PM
To: Tapestry users
Subject: Re: Tapernate/squeezer chain - squeezing null bug

Here's the stack trace if anyone is interested;
http://paste.uni.cc/9180

2006/5/29, Ted Steen <te...@gmail.com>:
> When squeezing an object that is null,
> EntitySqueezerFilter.squeeze(EntitySqueezerFilter.java:57) throws NPE.
> It doesn't matter if it is an entity or not, because the object is
> passed through the chain, and eventually ends up in the
> EntitySqueezerFilter.
>
> A solution to this problem would be to either check for null in the
> squeeze method, or maybe let some kind of "null squeezer" (that
> squeezes the object to a single character, like X)  be the first
> DataSqueezerFilter in the chain.
>
> If the new squeezing chain is going into the Tapestry 4.1 API, maybe
> placing the "null squeezer" first in the chain would be a good idea as
> it eliminates the danger of getting NPEs in other, potentially buggy
> 3rd party squeezers implementations.
>
> ted
>


-- 
ted

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapernate/squeezer chain - squeezing null bug

Posted by Ted Steen <te...@gmail.com>.
Here's the stack trace if anyone is interested;
http://paste.uni.cc/9180

2006/5/29, Ted Steen <te...@gmail.com>:
> When squeezing an object that is null,
> EntitySqueezerFilter.squeeze(EntitySqueezerFilter.java:57) throws NPE.
> It doesn't matter if it is an entity or not, because the object is
> passed through the chain, and eventually ends up in the
> EntitySqueezerFilter.
>
> A solution to this problem would be to either check for null in the
> squeeze method, or maybe let some kind of "null squeezer" (that
> squeezes the object to a single character, like X)  be the first
> DataSqueezerFilter in the chain.
>
> If the new squeezing chain is going into the Tapestry 4.1 API, maybe
> placing the "null squeezer" first in the chain would be a good idea as
> it eliminates the danger of getting NPEs in other, potentially buggy
> 3rd party squeezers implementations.
>
> ted
>


-- 
ted

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org