[ 
http://issues.apache.org/jira/browse/DERBY-333?page=comments#action_12361027 ] 

Knut Anders Hatlen commented on DERBY-333:
------------------------------------------

Bryan's proposed rewrite of getDRDAStatement() is a lot clearer than
the original code, and as far as I can tell, it does the exact same
thing. I have to change getDRDAStatement() anyway in my work with
DERBY-212. If no one objects or has better proposals, I will make this
change in my patch for DERBY-212.

> Malformed if statement in 
> org.apache.derby.impl.drda.Database.getDRDAStatement()
> --------------------------------------------------------------------------------
>
>          Key: DERBY-333
>          URL: http://issues.apache.org/jira/browse/DERBY-333
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Versions: 10.1.1.0
>  Environment: ------------------ Java Information ------------------
> Java Version:    1.4.2_05
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_05
> Java classpath:  
> c:\eclipse\db2jcc.jar;c:\eclipse\db2jcc_license_c.jar;C:\derby\derbyRecent\tools\java\jakarta-oro-2.0.8.jar;c:\derby\derbyRecent\classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  050503w
> Java user home:  C:\Documents and Settings\050503w
> Java user dir:   C:\derby\derbyRecent\classes
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\eclipse\db2jcc.jar] 2.4 - (17)
> [C:\eclipse\db2jcc_license_c.jar] 2.4 - (17)
> [C:\derby\derbyRecent\classes] 10.1.0.0 alpha - (???)
> [C:\derby\derbyRecent\classes] 10.1.0.0 alpha - (???)
> ------------------------------------------------------
>     Reporter: Philip Wilder

>
> Semicolon where it should not be (see the <!-- --> comment):
>       protected DRDAStatement getDRDAStatement(String pkgnamcsn) 
>               throws SQLException
>       {
>               // Need to get the short version because resultSets have 
> different
>               // corelation ids.
>               String key = getStmtKey(pkgnamcsn);
>               DRDAStatement newStmt = null;
>               // If our current statement doesn't match,retrieve the statement
>               // and make it current if not null.
>             // <!-- Note the semicolon after the if statement -->
>               if (currentStatement == null || 
>                       
> !key.equals(getStmtKey(currentStatement.getPkgnamcsn()))); 
>                       {
>                               newStmt  = (DRDAStatement) stmtTable.get(key);  
>                         
>                       }
>                       
>                       if (newStmt != null)     // don't blow away 
> currentStatement if we can't find this one
>                               currentStatement = newStmt;
>                       else
>                               return null;
>               // Set the correct result set.
>               currentStatement.setCurrentDrdaResultSet(pkgnamcsn);
>               return currentStatement;
>       }
> Solution is to remove the semicolon, all that is needed is a committer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to