Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 927C793F4 for ; Tue, 11 Sep 2012 13:32:27 +0000 (UTC) Received: (qmail 65534 invoked by uid 500); 11 Sep 2012 13:32:27 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 65495 invoked by uid 500); 11 Sep 2012 13:32:26 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 65485 invoked by uid 99); 11 Sep 2012 13:32:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2012 13:32:26 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.medinets@gmail.com designates 74.125.83.41 as permitted sender) Received: from [74.125.83.41] (HELO mail-ee0-f41.google.com) (74.125.83.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2012 13:32:20 +0000 Received: by eeke49 with SMTP id e49so477244eek.0 for ; Tue, 11 Sep 2012 06:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=1t63vNXkwMzU1e2dV4VtXZox61AupP2USRhyDIft1vc=; b=dty57lSrKKk2IAFmab38XVzZoNI1AhbA1f4l1FGOF+u2NTknQmxq+ui2SZiVSS35FG 1JL8ZwVgrIppUVEcQuGOP92W4B9GoP5w0epYDWYf6xxk6M/f7ur9CPkrXv+zNZLucZxM mAFqMs2IGDg1og4tlTCTDEhn0fd/0HIR0v5VaZiYHsz4iBU+/b1AyyCY2s6My2ZPK6Y0 Sw51e4fp64bYC5hkqr8prcGbkzRZn9tS/045zDcI9QuwO8ohIQ0wGlsdO/9bWGjAZfRV eYhXmwsSVmqDZZINs14qgaPfksFX4VRPjW//A9fMfuOW/RSMy5DXbPWGLnicgg++ewjZ mi5A== MIME-Version: 1.0 Received: by 10.204.130.209 with SMTP id u17mr4721861bks.35.1347370318718; Tue, 11 Sep 2012 06:31:58 -0700 (PDT) Received: by 10.205.40.7 with HTTP; Tue, 11 Sep 2012 06:31:58 -0700 (PDT) Date: Tue, 11 Sep 2012 09:31:58 -0400 Message-ID: Subject: Can Mutation.readFields return Mutation instead fo void? From: David Medinets To: accumulo-dev Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I am looking to simplify some. Here is the code I am looking at: private Mutation cloneMutation(Mutation m) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); m.write(dos); dos.close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); DataInputStream dis = new DataInputStream(bais); Mutation m = new Mutation(); m.readFields(dis); return m; } The readFields method in Mutation starts like this: @Override public void readFields(DataInput in) throws IOException { ... } It seems harmless to have readFields return 'this' instead fo void. Any objections? On a slightly different note, it seems like readFields should actually be a constructor. Because it's job is to set the row, data, value, and entries. Just as the other constructors do. Any objections to converting it to a constructor.