db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-333) Malformed if statement in org.apache.derby.impl.drda.Database.getDRDAStatement()
Date Tue, 20 Dec 2005 11:13:31 GMT
    [ http://issues.apache.org/jira/browse/DERBY-333?page=comments#action_12360904 ] 

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

Could someone with knowledge about the network server code comment on
this issue? I don't think removing the semicolon is the right thing to
do, as it broke derbyall for me. But there clearly is something wrong
with the if statement.

First of all, there are no side effects of the expressions in the
condition. Also, the indentation of the code and the comments indicate
that the if statement is supposed to do something else than what it
actually does.

> 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


Mime
View raw message