[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16797109#comment-16797109 ] Swapnil M Mane commented on OFBIZ-10832: Done the improvement of moving the nodeType check after node.getTextContent() method call Since most nodes will contain text then it will be more efficient to do a null check after retrieving nodeValue. trunk at rev 1855898 release18.12 at rev 1855899 release17.12 at rev 1855900 release16.11 at rev 1855901 Thank you [~lektran] for your valuable inputs. > 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 > Fix For: 16.11.06 > > 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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789152#comment-16789152 ] Swapnil M Mane commented on OFBIZ-10832: Thank you [~deepak.dixit] for your input, will add the comment in code. > 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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16788517#comment-16788517 ] Deepak Dixit commented on OFBIZ-10832: -- Hi Swapnil, Your patch looks good to me, it would be good if you comment in code as well. > 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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16764889#comment-16764889 ] Swapnil M Mane commented on OFBIZ-10832: Hello team, I have attached the patch to fix the issue. Since we can't get the value of Document, Document Type and Notation Node from getTextContent() method, we should simply return the same object. Please have a look into the patch and let me know if you any feedback. 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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16764885#comment-16764885 ] Swapnil M Mane commented on OFBIZ-10832: Thanks, Deepak! :-) > 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 > > 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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16764818#comment-16764818 ] Swapnil M Mane commented on OFBIZ-10832: This issue is caught after this improvement OFBIZ-10712 Previously, modelService.makeValid method was used only when the service definition has a permission service call. Now, this method is used every time, which internally calls simpleTypeConvert method. This is how we are able to get this issue. > 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 > > 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)
[jira] [Commented] (OFBIZ-10832) simpleTypeConvert always returns Null for Document, Document Type and Notation Node
[ https://issues.apache.org/jira/browse/OFBIZ-10832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16764820#comment-16764820 ] Deepak Dixit commented on OFBIZ-10832: -- Good catch Swapnil!! > 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 > > 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)