You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mathieu Lirzin (Jira)" <ji...@apache.org> on 2019/12/01 17:47:00 UTC

[jira] [Commented] (OFBIZ-11281) Possible Nullpointer in StringUtil#strToMap

    [ https://issues.apache.org/jira/browse/OFBIZ-11281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16985636#comment-16985636 ] 

Mathieu Lirzin commented on OFBIZ-11281:
----------------------------------------

[~uHeidfeld] Thanks for your answer, Indeed for dates there is no notion of emptiness like in collections, the Optional<T> class can model the emptiness for such kind of types in a type safe manner. IMO there is no need to worry about allocating empty collections (The JVM is very powerful and such allocation is most case negligeable).

After some investigation it appears that strToMap is only used in the framework in /ofbiz/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java for doing ad-hoc parsing (meaning not good ;-)) that will eventually be reimplemented which would lead to strToMap deprecation/removal, as a consequence  I think you should consider using your own implementation of map parsing to replace strToMap in your code.

[~nmalin] As I understand it, {{StringUtil}} is mostly legacy stuff that will be deprecated/removed sooner or later so I am not sure adding more flexibility is desirable in this context, it would be better to work on getting rid of remaining legacy code and in the case of ‘strToXXX‘ use standard serialisation formats like JSON, XML, CSV or other alternatives but backed with a serious parser. :-)

> Possible Nullpointer in StringUtil#strToMap
> -------------------------------------------
>
>                 Key: OFBIZ-11281
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11281
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: Trunk
>            Reporter: Ulrich Heidfeld
>            Assignee: Nicolas Malin
>            Priority: Critical
>             Fix For: 17.12.01, Upcoming Branch, 18.12.01
>
>         Attachments: OFBIZ-11281_Possible_Nullpointer_in_StringUtil#strToMap.patch
>
>
> StringUtil#strToMap(String, String, boolean, String) throws Nullpointer for StringUtil.strToMap("", false).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)