From: Paul T. <pt...@gm...> - 2007-01-13 16:15:10
|
ah, cool, so my null check's not necessary, but at least that one change (from contains to indexOf) will make it 1.4 compat. thanks On 1/12/07, Jimmy Zhang <cra...@co...> wrote: > Yes, you are correct on s1 being a null pointer, and during the design I > have thought > about this case... but it turned out that if the XPath is compiled > correctly, a string will > never be null, in xpath 1.0 spec, in the worst case, the string returns a > zero length string > "". So null actually never occurs... > > > ----- Original Message ----- > From: "Paul Tomsic" <pt...@gm...> > To: "Jimmy Zhang" <cra...@co...> > Cc: <vtd...@li...> > Sent: Thursday, January 11, 2007 11:34 AM > Subject: Re: [Vtd-xml-users] patch for 1.4 jdk compat... > > > > sure. > > it's really just a replacement of the String.contains() method, to a > > indexOf() > > > > also i do null checking, since that method itself could throw a > > nullptr if "s1" is null. > > not sure if that's the intention or not. > > > > 265c265 > > < return s1.contains(s2); > > --- > >> return s1 != null && s2 != null && s1.indexOf(s2) != -1; > > > > > > the top one is the way it exists currently, and the bottom one is my > > change > > (FuncExpr.java:265) > > > > > > On 1/11/07, Jimmy Zhang <cra...@co...> wrote: > >> I am running windows so is there a full text version you can > >> email to me directly? I kinda have trouble open the diff file... > >> > >> ----- Original Message ----- > >> From: "Paul Tomsic" <pt...@gm...> > >> To: <vtd...@li...> > >> Sent: Thursday, January 11, 2007 9:42 AM > >> Subject: [Vtd-xml-users] patch for 1.4 jdk compat... > >> > >> > >> > hi, i noticed that there's only one line of code in the codebase (at > >> > least as of today's cvs) that makes vtd not backward compat w/ 1.4. > >> > > >> > i've attached a patch for FuncExpr.java. hopefully this is helpful > >> > > >> > >> > >> -------------------------------------------------------------------------------- > >> > >> > >> > ------------------------------------------------------------------------- > >> > Take Surveys. Earn Cash. Influence the Future of IT > >> > Join SourceForge.net's Techsay panel and you'll get the chance to share > >> > your > >> > opinions on IT & business topics through brief surveys - and earn cash > >> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > >> > >> > >> -------------------------------------------------------------------------------- > >> > >> > >> > _______________________________________________ > >> > Vtd-xml-users mailing list > >> > Vtd...@li... > >> > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > >> > > >> > >> > >> > > > > > |