Return-Path: Delivered-To: apmail-incubator-cassandra-dev-archive@minotaur.apache.org Received: (qmail 84622 invoked from network); 17 Jun 2009 00:31:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jun 2009 00:31:42 -0000 Received: (qmail 39508 invoked by uid 500); 17 Jun 2009 00:31:54 -0000 Delivered-To: apmail-incubator-cassandra-dev-archive@incubator.apache.org Received: (qmail 39486 invoked by uid 500); 17 Jun 2009 00:31:54 -0000 Mailing-List: contact cassandra-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-dev@incubator.apache.org Received: (qmail 39476 invoked by uid 99); 17 Jun 2009 00:31:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 00:31:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of edward.ribeiro@gmail.com designates 74.125.46.153 as permitted sender) Received: from [74.125.46.153] (HELO yw-out-1718.google.com) (74.125.46.153) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 00:31:44 +0000 Received: by yw-out-1718.google.com with SMTP id 5so2610467ywr.0 for ; Tue, 16 Jun 2009 17:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=Zoi5wZKALWxrQUDx7lSpMhfh/RiUrEsH0d1jWdSLkX0=; b=b5rRyGj2QUrtvYvCH8HEo9AaEZZBNtfK8J1PphXeuQ0N3UYZ87/HYp5cozDEr3bmiJ UQWQr00x09xV6T1FCILFcM3jMejhvqHoppg6rU4NnYaeA06j/cQaKN7UVHwJjYBCY/8Y lWrBhLaK56ABoluRbvOvEHxXPgVtlA5Hmi7wo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=v4s7/x/CHv/9flrq4ZlqXA7U5N4sBQ8JjXDkjICI5RZ5xN5t8g7EHNQ0AmFo7RKqG9 fObfjNAtoIDc6j2wDDwPn5NN+5hV//bcX3OGLf6toipZTgiQrkYoMgohf74bKZZ4JOS3 Q70U8c/SORBH6pbYVfsZWq5UnclmycJFE6TIE= MIME-Version: 1.0 Received: by 10.151.136.13 with SMTP id o13mr16823486ybn.100.1245198683829; Tue, 16 Jun 2009 17:31:23 -0700 (PDT) Date: Tue, 16 Jun 2009 21:31:23 -0300 Message-ID: <123dcca0906161731t3894f054n128a0115964ddee4@mail.gmail.com> Subject: Column assert From: Edward Ribeiro To: cassandra-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Dear developers, I saw the following piece of the code in the Column class: Column(String name, byte[] value, long timestamp, boolean isDeleted) { assert name != null; assert value != null; [ ... ] } Well, the assert is a debug facility and it should not be used in production code, because it only throws an exception when the code is run with the -ea switch. There are other classes that follow the same behaviour in Cassandra code base. If this is being used in place of a null checking "if" statement then I would be glad to submit a couple of patches to fix that. By the way, I saw that Cassandra project currently uses the very good google collections library. Therefore, the code can become even more succint like: import static com.google.common.base.Preconditions.*; [...] Column(String name, byte[] value, long timestamp, boolean isDeleted) { assertNotNull(name,"Column name cannot be null!"); assertNotNull(value, "Byte array cannot be null!"); [...] } Best regards, Edward