Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 37585 invoked from network); 26 Feb 2008 14:02:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2008 14:02:56 -0000 Received: (qmail 85337 invoked by uid 500); 26 Feb 2008 14:02:51 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 85300 invoked by uid 500); 26 Feb 2008 14:02:50 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 85289 invoked by uid 99); 26 Feb 2008 14:02:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 06:02:50 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 14:02:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7BAF21A9832; Tue, 26 Feb 2008 06:02:32 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r631217 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/stmtcache/StatementKey.java Date: Tue, 26 Feb 2008 14:02:32 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080226140232.7BAF21A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kristwaa Date: Tue Feb 26 06:02:31 2008 New Revision: 631217 URL: http://svn.apache.org/viewvc?rev=631217&view=rev Log: DERBY-3438: Allow SQL query text to be null in StatementKey. Patch file: derby-3438-1a-allow_sql_null.diff Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/stmtcache/StatementKey.java Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/stmtcache/StatementKey.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/stmtcache/StatementKey.java?rev=631217&r1=631216&r2=631217&view=diff ============================================================================== --- db/derby/code/trunk/java/client/org/apache/derby/client/am/stmtcache/StatementKey.java (original) +++ db/derby/code/trunk/java/client/org/apache/derby/client/am/stmtcache/StatementKey.java Tue Feb 26 06:02:31 2008 @@ -67,17 +67,14 @@ * @param rsHoldability result set holdability * @param autogeneratedKeys if auto-generated keys are returned * - * @throws IllegalArgumentException if sql and/or - * schema is null + * @throws IllegalArgumentException if {@code schema} is {@code null} */ StatementKey(boolean isCallableStatement, String sql, String schema, int rsType, int rsConcurrency, int rsHoldability, int autogeneratedKeys) { - if (sql == null || schema == null) { + if (schema == null) { // Not localized (yet), because this should never reach the user. - throw new IllegalArgumentException( - "sql and/or schema is : sql=" + (sql == null) + - ", schema=" + (schema == null)); + throw new IllegalArgumentException("schema is "); } this.isCallableStatement = isCallableStatement; this.sql = sql; @@ -125,6 +122,9 @@ if (!this.schema.equals(other.schema)) { return false; } + if (this.sql == null && other.sql != null) { + return false; + } if (!this.sql.equals(other.sql)) { return false; } @@ -140,7 +140,7 @@ public int hashCode() { int hash = 7; hash = 47 * hash + (this.isCallableStatement ? 1 : 0); - hash = 47 * hash + this.sql.hashCode(); + hash = 47 * hash + (this.sql == null ? 3 : this.sql.hashCode()); hash = 47 * hash + this.schema.hashCode(); hash = 47 * hash + this.type; hash = 47 * hash + this.concurrency;