Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 316DBD620 for ; Wed, 27 Jun 2012 06:27:53 +0000 (UTC) Received: (qmail 81441 invoked by uid 500); 27 Jun 2012 06:27:53 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 80805 invoked by uid 500); 27 Jun 2012 06:27:52 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 80209 invoked by uid 99); 27 Jun 2012 06:27:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2012 06:27:50 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anchela@adobe.com designates 64.18.1.21 as permitted sender) Received: from [64.18.1.21] (HELO exprod6og108.obsmtp.com) (64.18.1.21) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2012 06:27:40 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob108.postini.com ([64.18.5.12]) with SMTP ID DSNKT+qnxg0LMlVkhikwApCibhgqFRqkJ8LJ@postini.com; Tue, 26 Jun 2012 23:27:20 PDT Received: from inner-relay-1.corp.adobe.com (inner-relay-1.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q5R6RHX9029790 for ; Tue, 26 Jun 2012 23:27:17 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q5R6RGvm002814 for ; Tue, 26 Jun 2012 23:27:16 -0700 (PDT) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.192.1; Tue, 26 Jun 2012 23:27:19 -0700 Received: from angela.corp.adobe.com (10.132.1.18) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.192.1; Wed, 27 Jun 2012 07:27:17 +0100 Message-ID: <4FEAA7C2.8030706@adobe.com> Date: Wed, 27 Jun 2012 08:27:14 +0200 From: Angela Schreiber User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Subject: 2 comments regarding commit: r1353771 References: <20120625225026.E307023888CD@eris.apache.org> In-Reply-To: <20120625225026.E307023888CD@eris.apache.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit hi jukka i have two minor comments regarding the memory value optimization: a) is it on purpose that the value constructors are public? as far as i saw they are only used by the factory... (which i would prefer) b) the following method lists PropertyType.DECIMAL twice. not sure if that was a copy-paste error or if you actually wanted another type here... maybe BOOLEAN? that would make sense IMO as you otherwise create boolean values with the GenericValue although you have an extra object for that: > + @Override > + public CoreValue createValue(String value, final int type) { > + if (type == PropertyType.BINARY) { > + try { > + return new BinaryValue(value.getBytes("UTF-8")); > + } catch (UnsupportedEncodingException e) { > + throw new IllegalStateException("UTF-8 is not supported", e); > + } > + } else if (type == PropertyType.DECIMAL) { > + return createValue(createValue(value).getDecimal()); > + } else if (type == PropertyType.DECIMAL) { > + return createValue(createValue(value).getDecimal()); > + } else if (type == PropertyType.DOUBLE) { > + return createValue(createValue(value).getDouble()); > + } else if (type == PropertyType.LONG) { > + return createValue(createValue(value).getLong()); > + } else if (type == PropertyType.STRING) { > + return createValue(value); > + } else { > + return new GenericValue(type, value); > + } > + } > + > +} regards angela