Re: svn commit: r1855403 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java

2019-03-20 Thread Scott Gray
Nice one, thanks Swapnil!

Regards
Scott

On Thu, 21 Mar 2019, 01:25 Swapnil M Mane,  wrote:

> Done with the suggested changes Scott.
>
> trunk at rev 1855898
> release18.12 at rev 1855899
> release17.12 at rev 1855900
> release16.11 at rev 1855901
>
> Thanks again for valuable inputs.
>
> - Best Regards,
> Swapnil M Mane,
> ofbiz.apache.org
>
>
>
> On Fri, Mar 15, 2019 at 9:52 AM Swapnil M Mane 
> wrote:
>
> > Makes perfect sense, thanks so much for the input Scott.
> > I will do the suggested changes.
> >
> >
> > - Best Regards,
> > Swapnil M Mane,
> > ofbiz.apache.org
> >
> >
> >
> > On Fri, Mar 15, 2019 at 5:36 AM Scott Gray  >
> > wrote:
> >
> >> Hi Swapnil,
> >>
> >> A minor thing, but I wonder if it would be better to move this check
> >> underneath node.getTextContent()?  If we assume that most nodes will
> >> contain text then it might be more efficient to do a null check after
> >> retrieving nodeValue.
> >>
> >> e.g.
> >> Node node = (Node) obj;
> >> String nodeValue =  node.getTextContent();
> >> if (nodeValue == null) {
> >>   // Check node type and return obj;
> >> }
> >> if ("String".equals(type) || "java.lang.String".equals(type)) {
> >>  return nodeValue;
> >> ...
> >>
> >> Regards
> >> Scott
> >>
> >>
> >> On Thu, 14 Mar 2019, 01:27 ,  wrote:
> >>
> >> > Author: swapnilmmane
> >> > Date: Wed Mar 13 12:27:13 2019
> >> > New Revision: 1855403
> >> >
> >> > URL: http://svn.apache.org/viewvc?rev=1855403&view=rev
> >> > Log:
> >> > Fixed: simpleTypeConvert always returns Null for Document, Document
> Type
> >> > and Notation Node (OFBIZ-10832)
> >> >
> >> > As per the 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]
> >> >
> >> > Since we can't get the text value of Document, Document Type and
> >> Notation
> >> > Node, thus simply return the same object.
> >> >
> >> > [1]
> >> >
> >>
> https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent()
> >> >
> >> > Thanks: Deepak Dixit for reviewing the code.
> >> >
> >> > Modified:
> >> >
> >> >
> >>
> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
> >> >
> >> > Modified:
> >> >
> >>
> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
> >> > URL:
> >> >
> >>
> http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java?rev=1855403&r1=1855402&r2=1855403&view=diff
> >> >
> >> >
> >>
> ==
> >> > ---
> >> >
> >>
> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
> >> > (original)
> >> > +++
> >> >
> >>
> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
> >> > Wed Mar 13 12:27:13 2019
> >> > @@ -289,6 +289,17 @@ public class ObjectType {
> >> >  }
> >> >  if (obj instanceof Node) {
> >> >  Node node = (Node) obj;
> >> > +
> >> > +/* We can't get the text value of Document, Document Type
> >> and
> >> > Notation Node,
> >> > + * thus simply returning the same object from
> >> > simpleTypeOrObjectConvert method.
> >> > + * Please refer to OFBIZ-10832 Jira and
> >> > + *
> >> >
> >>
> https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent()
> >> > for more details.
> >> > + */
> >> > +short nodeType = node.getNodeType();
> >> > +if (Node.DOCUMENT_NODE == nodeType ||
> >> Node.DOCUMENT_TYPE_NODE
> >> > == nodeType || Node.NOTATION_NODE == nodeType) {
> >> > +return obj;
> >> > +}
> >> > +
> >> >  String nodeValue =  node.getTextContent();
> >> >  if ("String".equals(type) ||
> >> "java.lang.String".equals(type))
> >> > {
> >> >  return nodeValue;
> >> >
> >> >
> >> >
> >>
> >
>


Re: svn commit: r1855798 - /ofbiz/ofbiz-framework/trunk/build.gradle

2019-03-20 Thread Mathieu Lirzin
Hello Michael,

Michael Brohl  writes:

> don't we have Jira's for all these changes?
>
> If yes, please provide the issue number within the commit message so
> that we have them in the monthly blog post/dev details.
>
> If no, we should have them, at least in the future.

Sorry if the process I followed was not the right one.

I must confess that the policy regarding how refactoring (done by
committers) must be handled in term of JIRA creation, is not clear to
me.  The block “When to create a Jira issue” on OFBiz wiki [1] is not
helping much in that regard.  Maybe there is an implicit consensus in
that regard that I am not aware of?

My reasoning for not creating a JIRA was that those commits are pure
refactoring meaning they are implementation details that don't change
the observable behavior of the build and they are not part of a global
plan.  Basically those cleanups happened by looking around while working
on OFBIZ-10866 [2] but are unrelated to the endeavour of that task.

What would you recommend in that scenario?

> If these changes affect the documentation, the README.md should also
> be edited to reflect them and stay in sync with the code.

Sure I agree that's an important guideline to follow.

Thanks.

[1] 
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Contributors+Best+Practices
[2] https://issues.apache.org/jira/browse/OFBIZ-10866

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37


Re: svn commit: r1855403 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java

2019-03-20 Thread Swapnil M Mane
Done with the suggested changes Scott.

trunk at rev 1855898
release18.12 at rev 1855899
release17.12 at rev 1855900
release16.11 at rev 1855901

Thanks again for valuable inputs.

- Best Regards,
Swapnil M Mane,
ofbiz.apache.org



On Fri, Mar 15, 2019 at 9:52 AM Swapnil M Mane 
wrote:

> Makes perfect sense, thanks so much for the input Scott.
> I will do the suggested changes.
>
>
> - Best Regards,
> Swapnil M Mane,
> ofbiz.apache.org
>
>
>
> On Fri, Mar 15, 2019 at 5:36 AM Scott Gray 
> wrote:
>
>> Hi Swapnil,
>>
>> A minor thing, but I wonder if it would be better to move this check
>> underneath node.getTextContent()?  If we assume that most nodes will
>> contain text then it might be more efficient to do a null check after
>> retrieving nodeValue.
>>
>> e.g.
>> Node node = (Node) obj;
>> String nodeValue =  node.getTextContent();
>> if (nodeValue == null) {
>>   // Check node type and return obj;
>> }
>> if ("String".equals(type) || "java.lang.String".equals(type)) {
>>  return nodeValue;
>> ...
>>
>> Regards
>> Scott
>>
>>
>> On Thu, 14 Mar 2019, 01:27 ,  wrote:
>>
>> > Author: swapnilmmane
>> > Date: Wed Mar 13 12:27:13 2019
>> > New Revision: 1855403
>> >
>> > URL: http://svn.apache.org/viewvc?rev=1855403&view=rev
>> > Log:
>> > Fixed: simpleTypeConvert always returns Null for Document, Document Type
>> > and Notation Node (OFBIZ-10832)
>> >
>> > As per the 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]
>> >
>> > Since we can't get the text value of Document, Document Type and
>> Notation
>> > Node, thus simply return the same object.
>> >
>> > [1]
>> >
>> https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent()
>> >
>> > Thanks: Deepak Dixit for reviewing the code.
>> >
>> > Modified:
>> >
>> >
>> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
>> >
>> > Modified:
>> >
>> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java?rev=1855403&r1=1855402&r2=1855403&view=diff
>> >
>> >
>> ==
>> > ---
>> >
>> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
>> > (original)
>> > +++
>> >
>> ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
>> > Wed Mar 13 12:27:13 2019
>> > @@ -289,6 +289,17 @@ public class ObjectType {
>> >  }
>> >  if (obj instanceof Node) {
>> >  Node node = (Node) obj;
>> > +
>> > +/* We can't get the text value of Document, Document Type
>> and
>> > Notation Node,
>> > + * thus simply returning the same object from
>> > simpleTypeOrObjectConvert method.
>> > + * Please refer to OFBIZ-10832 Jira and
>> > + *
>> >
>> https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent()
>> > for more details.
>> > + */
>> > +short nodeType = node.getNodeType();
>> > +if (Node.DOCUMENT_NODE == nodeType ||
>> Node.DOCUMENT_TYPE_NODE
>> > == nodeType || Node.NOTATION_NODE == nodeType) {
>> > +return obj;
>> > +}
>> > +
>> >  String nodeValue =  node.getTextContent();
>> >  if ("String".equals(type) ||
>> "java.lang.String".equals(type))
>> > {
>> >  return nodeValue;
>> >
>> >
>> >
>>
>


Re: svn commit: r1855798 - /ofbiz/ofbiz-framework/trunk/build.gradle

2019-03-20 Thread Michael Brohl

Hi Mathieu,

don't we have Jira's for all these changes?

If yes, please provide the issue number within the commit message so 
that we have them in the monthly blog post/dev details.


If no, we should have them, at least in the future.

If these changes affect the documentation, the README.md should also be 
edited to reflect them and stay in sync with the code.


Thanks for your work!

Michael

Am 19.03.19 um 00:19 schrieb m...@apache.org:

Author: mthl
Date: Mon Mar 18 23:19:44 2019
New Revision: 1855798

URL: http://svn.apache.org/viewvc?rev=1855798&view=rev
Log:
Improved: Merge regexps inside ‘createOfbizCommandTask’

Modified:
 ofbiz/ofbiz-framework/trunk/build.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1855798&r1=1855797&r2=1855798&view=diff
==
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Mon Mar 18 23:19:44 2019
@@ -984,9 +984,7 @@ def createOfbizCommandTask(taskName, arg
  classpath = files(jar.outputs)
  main = ofbizMainClass
  args arguments
-
-if (taskName ==~ /^ofbiz.*--test.*/
-|| taskName ==~ /^ofbiz.*-t.*/) {
+if (taskName ==~ /^ofbiz.*(--test|-t).*/) {
  finalizedBy(createTestReports)
  }
  }






smime.p7s
Description: S/MIME Cryptographic Signature