Re: svn commit: r1798104 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityListIterator.java

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

Re: svn commit: r1798104 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityListIterator.java

taher
I think this log message looks bad in addition to being platform dependent
with EOL character. Perhaps it should be properly formatted as it looks off
and 220 characters wide for no good reason.

On Thu, Jun 8, 2017 at 9:39 PM, <[hidden email]> wrote:

> Author: jleroux
> Date: Thu Jun  8 18:39:23 2017
> New Revision: 1798104
>
> URL: http://svn.apache.org/viewvc?rev=1798104&view=rev
> Log:
> No functional change.
>
> Adds a suggestion to report in case of EntityListIterator Not Closed
>
> Modified:
>     ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>
> Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
> java/org/apache/ofbiz/entity/util/EntityListIterator.java
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
> framework/entity/src/main/java/org/apache/ofbiz/entity/
> util/EntityListIterator.java?rev=1798104&r1=1798103&r2=1798104&view=diff
> ============================================================
> ==================
> --- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
> java/org/apache/ofbiz/entity/util/EntityListIterator.java (original)
> +++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
> java/org/apache/ofbiz/entity/util/EntityListIterator.java Thu Jun  8
> 18:39:23 2017
> @@ -525,7 +525,8 @@ public class EntityListIterator implemen
>          try {
>              if (!closed) {
>                  this.close();
> -                Debug.logError("\n============
> ========================================================\n
> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
> modelEntity.getEntityName()) + "], caught in Finalize\n
> ====================================================================\n",
> module);
> +                Debug.logError("\n============
> ==================================================================\n
> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
> modelEntity.getEntityName())
> +                        + "], caught in Finalize\n Please report by
> creating an OFBIZ-9297 subtask with the stack trace,
> thanks\n==============================================================================\n",
> module);
>              }
>          } catch (Exception e) {
>              Debug.logError(e, "Error closing the SQLProcessor in finalize
> EntityListIterator", module);
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1798104 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbi z/entity/util/EntityListIterator.java

Jacques Le Roux
Administrator
Actually I just added "\n Please report by creating an OFBIZ-9297 subtask with the stack trace, thanks"

And this is what I get on Windows:

2017-06-09 15:50:02,703 |Finalizer |EntityListIterator            |E|
==============================================================================
  EntityListIterator Not Closed for Entity [SurveyQuestionAndAppl], caught in Finalize
  Please report by creating an OFBIZ-9297 subtask with the stack trace, thanks
==============================================================================

So it's not an issue on Windows despite using \n which is *nix specific.

This is because Debug.log() uses StringBuilder + Formatter https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html where

'n' is a line separator and the result is the platform-specific line separator

So using \n with Debug.log() is fine.

This said at 1st glance it's only a small part of the \n used in OFBiz and maybe other cases are worth changing to System.getProperty("line.separator")

Jacques

Le 09/06/2017 à 12:49, Taher Alkhateeb a écrit :

> I think this log message looks bad in addition to being platform dependent
> with EOL character. Perhaps it should be properly formatted as it looks off
> and 220 characters wide for no good reason.
>
> On Thu, Jun 8, 2017 at 9:39 PM,<[hidden email]>  wrote:
>
>> Author: jleroux
>> Date: Thu Jun  8 18:39:23 2017
>> New Revision: 1798104
>>
>> URL:http://svn.apache.org/viewvc?rev=1798104&view=rev
>> Log:
>> No functional change.
>>
>> Adds a suggestion to report in case of EntityListIterator Not Closed
>>
>> Modified:
>>      ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>
>> Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>> URL:http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
>> framework/entity/src/main/java/org/apache/ofbiz/entity/
>> util/EntityListIterator.java?rev=1798104&r1=1798103&r2=1798104&view=diff
>> ============================================================
>> ==================
>> --- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>> java/org/apache/ofbiz/entity/util/EntityListIterator.java (original)
>> +++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>> java/org/apache/ofbiz/entity/util/EntityListIterator.java Thu Jun  8
>> 18:39:23 2017
>> @@ -525,7 +525,8 @@ public class EntityListIterator implemen
>>           try {
>>               if (!closed) {
>>                   this.close();
>> -                Debug.logError("\n============
>> ========================================================\n
>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>> modelEntity.getEntityName()) + "], caught in Finalize\n
>> ====================================================================\n",
>> module);
>> +                Debug.logError("\n============
>> ==================================================================\n
>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>> modelEntity.getEntityName())
>> +                        + "], caught in Finalize\n Please report by
>> creating an OFBIZ-9297 subtask with the stack trace,
>> thanks\n==============================================================================\n",
>> module);
>>               }
>>           } catch (Exception e) {
>>               Debug.logError(e, "Error closing the SQLProcessor in finalize
>> EntityListIterator", module);
>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1798104 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbi z/entity/util/EntityListIterator.java

Scott Gray-3
Isn't a stacktrace pointless given that this would happen during finalize?
It wouldn't say anything about where the problem is.

Regards
Scott

On 10/06/2017 07:21, "Jacques Le Roux" <[hidden email]> wrote:

> Actually I just added "\n Please report by creating an OFBIZ-9297 subtask
> with the stack trace, thanks"
>
> And this is what I get on Windows:
>
> 2017-06-09 15:50:02,703 |Finalizer |EntityListIterator            |E|
> ============================================================
> ==================
>  EntityListIterator Not Closed for Entity [SurveyQuestionAndAppl], caught
> in Finalize
>  Please report by creating an OFBIZ-9297 subtask with the stack trace,
> thanks
> ============================================================
> ==================
>
> So it's not an issue on Windows despite using \n which is *nix specific.
>
> This is because Debug.log() uses StringBuilder + Formatter
> https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html where
>
> 'n' is a line separator and the result is the platform-specific line
> separator
>
> So using \n with Debug.log() is fine.
>
> This said at 1st glance it's only a small part of the \n used in OFBiz and
> maybe other cases are worth changing to System.getProperty("line.separ
> ator")
>
> Jacques
>
> Le 09/06/2017 à 12:49, Taher Alkhateeb a écrit :
>
>> I think this log message looks bad in addition to being platform dependent
>> with EOL character. Perhaps it should be properly formatted as it looks
>> off
>> and 220 characters wide for no good reason.
>>
>> On Thu, Jun 8, 2017 at 9:39 PM,<[hidden email]>  wrote:
>>
>> Author: jleroux
>>> Date: Thu Jun  8 18:39:23 2017
>>> New Revision: 1798104
>>>
>>> URL:http://svn.apache.org/viewvc?rev=1798104&view=rev
>>> Log:
>>> No functional change.
>>>
>>> Adds a suggestion to report in case of EntityListIterator Not Closed
>>>
>>> Modified:
>>>      ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>>
>>> Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>> URL:http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
>>> framework/entity/src/main/java/org/apache/ofbiz/entity/
>>> util/EntityListIterator.java?rev=1798104&r1=1798103&r2=1798104&view=diff
>>> ============================================================
>>> ==================
>>> --- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java (original)
>>> +++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java Thu Jun  8
>>> 18:39:23 2017
>>> @@ -525,7 +525,8 @@ public class EntityListIterator implemen
>>>           try {
>>>               if (!closed) {
>>>                   this.close();
>>> -                Debug.logError("\n============
>>> ========================================================\n
>>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>>> modelEntity.getEntityName()) + "], caught in Finalize\n
>>> ====================================================================\n",
>>> module);
>>> +                Debug.logError("\n============
>>> ==================================================================\n
>>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>>> modelEntity.getEntityName())
>>> +                        + "], caught in Finalize\n Please report by
>>> creating an OFBIZ-9297 subtask with the stack trace,
>>> thanks\n====================================================
>>> ==========================\n",
>>> module);
>>>               }
>>>           } catch (Exception e) {
>>>               Debug.logError(e, "Error closing the SQLProcessor in
>>> finalize
>>> EntityListIterator", module);
>>>
>>>
>>>
>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1798104 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbi z/entity/util/EntityListIterator.java

Jacques Le Roux
Administrator
At least you have the concerned Entity name, this helps sometimes

Jacques

Le 11/06/2017 à 20:27, Scott Gray a écrit :

> Isn't a stacktrace pointless given that this would happen during finalize?
> It wouldn't say anything about where the problem is.
>
> Regards
> Scott
>
> On 10/06/2017 07:21, "Jacques Le Roux" <[hidden email]> wrote:
>
>> Actually I just added "\n Please report by creating an OFBIZ-9297 subtask
>> with the stack trace, thanks"
>>
>> And this is what I get on Windows:
>>
>> 2017-06-09 15:50:02,703 |Finalizer |EntityListIterator            |E|
>> ============================================================
>> ==================
>>   EntityListIterator Not Closed for Entity [SurveyQuestionAndAppl], caught
>> in Finalize
>>   Please report by creating an OFBIZ-9297 subtask with the stack trace,
>> thanks
>> ============================================================
>> ==================
>>
>> So it's not an issue on Windows despite using \n which is *nix specific.
>>
>> This is because Debug.log() uses StringBuilder + Formatter
>> https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html where
>>
>> 'n' is a line separator and the result is the platform-specific line
>> separator
>>
>> So using \n with Debug.log() is fine.
>>
>> This said at 1st glance it's only a small part of the \n used in OFBiz and
>> maybe other cases are worth changing to System.getProperty("line.separ
>> ator")
>>
>> Jacques
>>
>> Le 09/06/2017 à 12:49, Taher Alkhateeb a écrit :
>>
>>> I think this log message looks bad in addition to being platform dependent
>>> with EOL character. Perhaps it should be properly formatted as it looks
>>> off
>>> and 220 characters wide for no good reason.
>>>
>>> On Thu, Jun 8, 2017 at 9:39 PM,<[hidden email]>  wrote:
>>>
>>> Author: jleroux
>>>> Date: Thu Jun  8 18:39:23 2017
>>>> New Revision: 1798104
>>>>
>>>> URL:http://svn.apache.org/viewvc?rev=1798104&view=rev
>>>> Log:
>>>> No functional change.
>>>>
>>>> Adds a suggestion to report in case of EntityListIterator Not Closed
>>>>
>>>> Modified:
>>>>       ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>>>
>>>> Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>>> URL:http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
>>>> framework/entity/src/main/java/org/apache/ofbiz/entity/
>>>> util/EntityListIterator.java?rev=1798104&r1=1798103&r2=1798104&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java (original)
>>>> +++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java Thu Jun  8
>>>> 18:39:23 2017
>>>> @@ -525,7 +525,8 @@ public class EntityListIterator implemen
>>>>            try {
>>>>                if (!closed) {
>>>>                    this.close();
>>>> -                Debug.logError("\n============
>>>> ========================================================\n
>>>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>>>> modelEntity.getEntityName()) + "], caught in Finalize\n
>>>> ====================================================================\n",
>>>> module);
>>>> +                Debug.logError("\n============
>>>> ==================================================================\n
>>>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>>>> modelEntity.getEntityName())
>>>> +                        + "], caught in Finalize\n Please report by
>>>> creating an OFBIZ-9297 subtask with the stack trace,
>>>> thanks\n====================================================
>>>> ==========================\n",
>>>> module);
>>>>                }
>>>>            } catch (Exception e) {
>>>>                Debug.logError(e, "Error closing the SQLProcessor in
>>>> finalize
>>>> EntityListIterator", module);
>>>>
>>>>
>>>>
>>>>

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1798104 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbi z/entity/util/EntityListIterator.java

Jacques Le Roux
Administrator
Mmm, yes the stack trace you are right, was not really awake :)

Jacques


Le 12/06/2017 à 08:41, Jacques Le Roux a écrit :

> At least you have the concerned Entity name, this helps sometimes
>
> Jacques
>
> Le 11/06/2017 à 20:27, Scott Gray a écrit :
>> Isn't a stacktrace pointless given that this would happen during finalize?
>> It wouldn't say anything about where the problem is.
>>
>> Regards
>> Scott
>>
>> On 10/06/2017 07:21, "Jacques Le Roux" <[hidden email]> wrote:
>>
>>> Actually I just added "\n Please report by creating an OFBIZ-9297 subtask
>>> with the stack trace, thanks"
>>>
>>> And this is what I get on Windows:
>>>
>>> 2017-06-09 15:50:02,703 |Finalizer |EntityListIterator            |E|
>>> ============================================================
>>> ==================
>>>   EntityListIterator Not Closed for Entity [SurveyQuestionAndAppl], caught
>>> in Finalize
>>>   Please report by creating an OFBIZ-9297 subtask with the stack trace,
>>> thanks
>>> ============================================================
>>> ==================
>>>
>>> So it's not an issue on Windows despite using \n which is *nix specific.
>>>
>>> This is because Debug.log() uses StringBuilder + Formatter
>>> https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html where
>>>
>>> 'n' is a line separator and the result is the platform-specific line
>>> separator
>>>
>>> So using \n with Debug.log() is fine.
>>>
>>> This said at 1st glance it's only a small part of the \n used in OFBiz and
>>> maybe other cases are worth changing to System.getProperty("line.separ
>>> ator")
>>>
>>> Jacques
>>>
>>> Le 09/06/2017 à 12:49, Taher Alkhateeb a écrit :
>>>
>>>> I think this log message looks bad in addition to being platform dependent
>>>> with EOL character. Perhaps it should be properly formatted as it looks
>>>> off
>>>> and 220 characters wide for no good reason.
>>>>
>>>> On Thu, Jun 8, 2017 at 9:39 PM,<[hidden email]> wrote:
>>>>
>>>> Author: jleroux
>>>>> Date: Thu Jun  8 18:39:23 2017
>>>>> New Revision: 1798104
>>>>>
>>>>> URL:http://svn.apache.org/viewvc?rev=1798104&view=rev
>>>>> Log:
>>>>> No functional change.
>>>>>
>>>>> Adds a suggestion to report in case of EntityListIterator Not Closed
>>>>>
>>>>> Modified:
>>>>> ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>>>>
>>>>> Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java
>>>>> URL:http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
>>>>> framework/entity/src/main/java/org/apache/ofbiz/entity/
>>>>> util/EntityListIterator.java?rev=1798104&r1=1798103&r2=1798104&view=diff
>>>>> ============================================================
>>>>> ==================
>>>>> --- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java (original)
>>>>> +++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/
>>>>> java/org/apache/ofbiz/entity/util/EntityListIterator.java Thu Jun  8
>>>>> 18:39:23 2017
>>>>> @@ -525,7 +525,8 @@ public class EntityListIterator implemen
>>>>>            try {
>>>>>                if (!closed) {
>>>>>                    this.close();
>>>>> -                Debug.logError("\n============
>>>>> ========================================================\n
>>>>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>>>>> modelEntity.getEntityName()) + "], caught in Finalize\n
>>>>> ====================================================================\n",
>>>>> module);
>>>>> +                Debug.logError("\n============
>>>>> ==================================================================\n
>>>>> EntityListIterator Not Closed for Entity [" + (modelEntity==null ? "" :
>>>>> modelEntity.getEntityName())
>>>>> +                        + "], caught in Finalize\n Please report by
>>>>> creating an OFBIZ-9297 subtask with the stack trace,
>>>>> thanks\n====================================================
>>>>> ==========================\n",
>>>>> module);
>>>>>                }
>>>>>            } catch (Exception e) {
>>>>>                Debug.logError(e, "Error closing the SQLProcessor in
>>>>> finalize
>>>>> EntityListIterator", module);
>>>>>
>>>>>
>>>>>
>>>>>
>
>