[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node

Nicolas Malin (Jira)

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

Swapnil M Mane commented on OFBIZ-10832:
----------------------------------------

Hello team,
If everyone is fine with this change, I am planning to commit this over the weekend.

Thanks!

> simpleTypeConvert always returns Null for Document, Document Type and Notation Node
> -----------------------------------------------------------------------------------
>
>                 Key: OFBIZ-10832
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10832
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: Trunk, Release Branch 16.11, Release Branch 17.12, Release Branch 18.12
>            Reporter: Swapnil M Mane
>            Assignee: Swapnil M Mane
>            Priority: Major
>         Attachments: OFBIZ-10832.patch
>
>
> simpleTypeConvert always returns Null for Document, Document Type and Notation Node
> The ObjectType.simpleTypeConvert method always returns null for Document, Document Type and Notation Node.
> As per the current code, getTextContent() method is used get text content of the node and its descendants but the node.getTextContent() always return Null for the following Node type
>  DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE [1]
> {code:java}
> if (obj instanceof Node) {
>     Node node = (Node) obj;
>     String nodeValue =  node.getTextContent();
>     if ("String".equals(type) || "java.lang.String".equals(type)) {
>       return nodeValue;
>     }
>     return simpleTypeConvert(nodeValue, type, format, timeZone, locale, noTypeFail);
> }
> {code}
> Since we can't get the text value of Document, Document Type and Notation Node, we should simply return the same object.
> [1] [https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent(])



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)