ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-9549) Refactor EntityListIterator
Date Fri, 04 Aug 2017 19:09:00 GMT

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

Jacques Le Roux commented on OFBIZ-9549:

Hi Tobias,

I reviewed your patch, I globally like it. I have few questions and opinions.
# Why do you prefer a return to an else in close() (I see why in absolute() and hasNext())
# Please explain
if (rowNum == 0 && resultSet.getType() != ResultSet.TYPE_FORWARD_ONLY) {
# While at it I'd prefer this formatting for this note
     * PLEASE NOTE: Because of the nature of the JDBC ResultSet interface this method can
be very inefficient
     *  It is much better to just use next() until it returns null
     *  For example, you could use the following to iterate through the results in an EntityListIterator:
Same in hasPrevious()
# I'd keep the comment
                // do a quick game to see if the resultSet is empty:
                // if we are not in the last or afterLast positions and we haven't made any
values yet, the result set is empty so return false
in hasPrevious()
# Why did you prefer an ArrayList vs a LinkedList in getCompleteList() and getPartialList().
Did you make some performance reviews using a profiler?


> Refactor EntityListIterator
> ---------------------------
>                 Key: OFBIZ-9549
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9549
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Tobias Laufkötter
>            Assignee: Jacques Le Roux
>            Priority: Minor
>         Attachments: OFBIZ-9549.patch
> The EntityListIterator contains duplicate code and has need for refactoring in general.

This message was sent by Atlassian JIRA

View raw message