You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Martin Cooper <ma...@apache.org> on 2003/01/25 06:22:58 UTC

Tiles XmlParser - cut & paste error?

Running PMD over the latest code, I think I've found a bug in the Tiles
XmlParser class. Lines 255 - 256 of this class look like this:

  String menuItemDefaultClass =
"org.apache.struts.tiles.beans.SimpleMenuItem";
	digester.addObjectCreate( ADD_WILDCARD, menuItemDefaultClass,
"classtype");

But then lines 262 - 263 look like this:

  String beanDefaultClass =
"org.apache.struts.tiles.beans.SimpleMenuItem";
	digester.addObjectCreate( BEAN_TAG, menuItemDefaultClass,
"classtype");

Note that in the first case, menuItemDefaultClass is defined, and then
used on the next line. In the second case, beanDefaultClass is defined,
but on the next line, menuItemDefaultClass is used again. My guess is that
this is a cut & paste error, and that line 263 should be using
beanDefaultClass instead of menuItemDefaultClass.

However, this is a guess, since I don't use this functionality. Hence this
message instead of just changing the code base. If someone who knows this
area could take a look and confirm/deny, that would be great.

--
Martin Cooper



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tiles XmlParser - cut & paste error?

Posted by Cedric Dumoulin <ce...@lifl.fr>.
  You are right, this is probably a cut&paste error.  I have corrected it.

    Cedric

Martin Cooper wrote:

>Running PMD over the latest code, I think I've found a bug in the Tiles
>XmlParser class. Lines 255 - 256 of this class look like this:
>
>  String menuItemDefaultClass =
>"org.apache.struts.tiles.beans.SimpleMenuItem";
>	digester.addObjectCreate( ADD_WILDCARD, menuItemDefaultClass,
>"classtype");
>
>But then lines 262 - 263 look like this:
>
>  String beanDefaultClass =
>"org.apache.struts.tiles.beans.SimpleMenuItem";
>	digester.addObjectCreate( BEAN_TAG, menuItemDefaultClass,
>"classtype");
>
>Note that in the first case, menuItemDefaultClass is defined, and then
>used on the next line. In the second case, beanDefaultClass is defined,
>but on the next line, menuItemDefaultClass is used again. My guess is that
>this is a cut & paste error, and that line 263 should be using
>beanDefaultClass instead of menuItemDefaultClass.
>
>However, this is a guess, since I don't use this functionality. Hence this
>message instead of just changing the code base. If someone who knows this
>area could take a look and confirm/deny, that would be great.
>
>--
>Martin Cooper
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org