Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-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 2052D7E90 for ; Wed, 12 Oct 2011 19:13:34 +0000 (UTC) Received: (qmail 75284 invoked by uid 500); 12 Oct 2011 19:13:33 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 75226 invoked by uid 500); 12 Oct 2011 19:13:33 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 75219 invoked by uid 99); 12 Oct 2011 19:13:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 19:13:33 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.1.33] (HELO exprod6og114.obsmtp.com) (64.18.1.33) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 19:13:24 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob114.postini.com ([64.18.5.12]) with SMTP; Wed, 12 Oct 2011 12:13:04 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 p9CJD1rg026905 for ; Wed, 12 Oct 2011 12:13:02 -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 p9CJD15R017150 for ; Wed, 12 Oct 2011 12:13:01 -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; Wed, 12 Oct 2011 12:13:01 -0700 Received: from susi.local (10.136.170.121) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.192.1; Wed, 12 Oct 2011 20:12:36 +0100 Message-ID: <4E95E6A3.2020308@apache.org> Date: Wed, 12 Oct 2011 20:12:35 +0100 From: =?ISO-8859-1?Q?Michael_D=FCrig?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Subject: Re: Curious method definition References: <4E9526EC.90704@apache.org> In-Reply-To: <4E9526EC.90704@apache.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit The else branch should probably be defs.add(new QPropertyDefinitionImpl(pd)); I created JCR-3110 [1] for this. Michael [1] https://issues.apache.org/jira/browse/JCR-3110 On 12.10.11 6:34, Dave Brosius wrote: > The following method in class / > / > > /org.apache.jackrabbit.spi.commons.QNodeTypeDefinitionImpl / > > would appear to return a set of serializable property definitions. > > However, it would appear that it just returns a set-version of the > passed in parameter, irrespective of whether the property defs are > serializable or not. > > A naive view would say the else block shouldn't be there. > > If all property defs should be returned, there are much simpler ways to > write this code. > > > > /** > * Returns a set of serializable property definitions for > * propDefs. > * > * @param propDefs the SPI property definitions. > * @return a set of serializable property definitions. > */ > private static Set getSerializablePropertyDefs( > QPropertyDefinition[] propDefs) { > Set defs = new HashSet(); > for (QPropertyDefinition pd : propDefs) { > if (pd instanceof Serializable) { > defs.add(pd); > } else { > *defs.add(pd);* > } > } > return defs; > }