Re: svn commit: r584611 - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/ apache/cayenne: ObjectId.java access/jdbc/SQLTemplateAction.java util/IndexPropertyList.java

From: Kevin Menard (kmenar..ervprise.com)
Date: Sun Oct 14 2007 - 18:27:55 EDT

  • Next message: Kevin Menard: "Re: Unit test failure"

    Because it was in a finally block. It appeared as though the break was
    added because returning from a finally is a big no-no. But, the break was
    essentially a noop for that one case. By inverting the logic and dealing
    with only the condition you care about, the other is a de facto noop.

    Hopefully I explained that well enough. It's late for me, too. I'm in my
    German hotel room whittling away time.

    -- 
    Kevin
    

    On 10/14/07 6:14 PM, "Andrus Adamchik" <andru..bjectstyle.org> wrote:

    > Hi Kevin, > > Nice work cleaning up the code tonight! > > One question - why do you think the break statement below is not > needed? (Keep in mind that it is past 1am in my TZ right now, so I > may be asking stupid/obvious stuff :-)) > > Andrus > > > On Oct 15, 2007, at 12:30 AM, kmenar..pache.org wrote: > >> Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/ >> src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java >> URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/ >> cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/ >> jdbc/SQLTemplateAction.java?rev=584611&r1=584610&r2=584611&view=diff >> ====================================================================== >> ======== >> --- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/ >> main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java >> (original) >> +++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/ >> main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java Sun >> Oct 14 14:30:39 2007 >>.. -159,10 +157,7 @@ >> t1); >> } >> finally { >> - if (iteratedResult) { >> - break; >> - } >> - else { >> + if (!iteratedResult) { >> resultSet.close(); >> } >> } >

    --



    This archive was generated by hypermail 2.0.0 : Sun Oct 14 2007 - 18:29:00 EDT