Re: Who broke it?
Ramsey Gurley <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
On Mar 7, 2013, at 12:14 PM, Johann Werner wrote: > Hi Ramsey, > > seems that one of my commits replacing deprecated method calls is the cause. The javadoc told to use ERXStringUtilities.replaceStringByStringInString instead of ERXExtensions.substituteStringByStringInString but it behaves differently if one or more parameters are null as you found out ;) Seems reasonable. Any reason why you chose to switch to ERXStringUtilities instead of using apache's StringUtils.replace instead? I noticed a lot of Wonder methods were being replaced by these lately. > I created a pull request to check for those. Probably that method was never thought of having null params so it should be ok to add that little behavior change. You are not concerned that changing the behavior on that method might break something else? It is called by 16 different methods in wonder. > Have a look at the pull request and merge it if you deem it ok. > I compared replaceStringByStringInString to substituteStringByStringInString and run some tests to find out that the former one is faster most of the time so I think it is a good thing to move to the new method. > > jw I think instead of changing behavior of replaceStringByStringInString, it would be safer to have the massageErrorMessage method handle the possibility of null gracefully if the new method it is using can return null. Thank you for finding this Johann :-) Ramsey > > > Am 07.03.2013 um 17:03 schrieb Ramsey Gurley <[email protected]>: > >> Hi All, >> >> My D2W query all page is broken. >> >> java.lang.NullPointerException >> at er.extensions.foundation.ERXStringUtilities.replaceStringByStringInString(ERXStringUtilities.java:692) >> at er.extensions.components.ERXErrorDictionaryPanel.massageErrorMessage(ERXErrorDictionaryPanel.java:92) >> at er.extensions.components.ERXErrorDictionaryPanel.appendToResponse(ERXErrorDictionaryPanel.java:152) >> >> I suspect any page with an ERXErrorDictionaryPanel may be broken. This was not happening on wonder commit 0a95d090b77986aaea711198881bed9bbd3494e9. It is happening as of commit 260475d82005d048ae5981a4da157c9b2ad12437. The null pointer is the result of the extraErrorMessage() is returning null where it did not before. >> >> Does this sound familiar to anyone? >> >> Ramsey > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > _______________________________________________ > Wonder-disc mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wonder-disc ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev