Re: Help - falling into 'jar hell' with Mav and JDOM

Mike Moulton <[email protected]> Sat, 27 Nov 2004 02:22:17 -0700
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
Responses inline...

> I've had a look at changing Maverick to use jdom 1.0, but as I've=20
> never used jdom myself, I am unsure what the changes should be and=20
> their implications. I've identified the three place in the Maverick=20
> code that need altered. #1 should be fine but I need help on #2 and=20
> #3. See below for what I've done so far, with some in-line comments. I=20=

> gleaned most information from changes.txt in the jdom 1.0=20
> distribution.

#1 and #3 look good. See notes by #2.

>
> #2 org.infohazard.maverick.util.XML.java
> ----------------------------------------
> public static Map getParams(Element node)
> {
> ...
>
> if (value =3D=3D null)
> {
>   /* OLD CODE: Checks for presence of children if no value present
>    * getChildren() now removed from v1.0
>   if (paramNode.hasChildren())
>     value =3D paramNode.getChildren();
>   else
>     value =3D paramNode.getTextTrim();
>   */
>
>   /* NEW CODE: Since this method expects what the name/value pair
>    * param nodes should look like (from this methods javadoc), is =
there
>    * actually any need to check for child elements?
>    */
>   value =3D paramNode.getTextTrim();
> }

Though the javadocs say the that a param should only look like <param=20
name=3D"" value=3D""/>, there has been support for child elements inside =
a=20
<param/> for a while. Not sure about others, but I know I have used=20
this 'feature' many times in the past. With that being the case I would=20=

do something like this for #2.

List paramChildren =3D paramNode.getChildren();
if (!paramChildren.isEmpty())
	value =3D paramChildren;
else
	value =3D paramNode.getTextTrim();


What are the thoughts of updating the jdom dependency of maverick? If=20
there are no objections I will do the updates and do a 2.2.4 release.

-- Mike

  :=A0 mike moulton
  :=A0 meltmedia
  :=A0 1429 north 1st street
  :=A0 phoenix=A0 az=A0 85004
  :
  :=A0 [email protected]
  :=A0 mmoulton66    | aim
  :=A0 602.340.9440 | ofc
  :=A0 602.432.2568 | cel
  :=A0 602.340.1003 | fax
  :
  :=A0 meltmedia.com



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
[INVALID FOOTER]