Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F71068C4 for ; Wed, 27 Jul 2011 17:15:10 +0000 (UTC) Received: (qmail 34930 invoked by uid 500); 27 Jul 2011 17:15:09 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 34678 invoked by uid 500); 27 Jul 2011 17:15:08 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 34667 invoked by uid 99); 27 Jul 2011 17:15:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 17:15:07 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paulus.benedictus@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vw0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 17:15:02 +0000 Received: by vws10 with SMTP id 10so1570197vws.30 for ; Wed, 27 Jul 2011 10:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+MkdYmSnnHGi+6sxwroSzPxwN2H4wYOkJxDahEul1yA=; b=K3y7piAECm8lzuhsWXsaT5/2/rOGhyhUVlpkrfL/L/7bFcvv+i59cv/RJzlwHaHORM RYpve4ehoHx0tsvnKxfY1j3uv9f+lNR5I3X1/HPb9bZ49V/mKo4moefNR5FeV5+TmaNp 6Zu4MbZfV015cVdeXsscVsDSrcLNgOJeYg5hY= MIME-Version: 1.0 Received: by 10.220.198.194 with SMTP id ep2mr8493vcb.233.1311786881671; Wed, 27 Jul 2011 10:14:41 -0700 (PDT) Sender: paulus.benedictus@gmail.com Received: by 10.220.176.201 with HTTP; Wed, 27 Jul 2011 10:14:41 -0700 (PDT) In-Reply-To: <47BE868E7D83AB47B70DB33395F669E2192ABAFF@SWI007.ams.intra.schiphol.nl> References: <47BE868E7D83AB47B70DB33395F669E2192ABAFF@SWI007.ams.intra.schiphol.nl> Date: Wed, 27 Jul 2011 12:14:41 -0500 X-Google-Sender-Auth: 5oP3K3Dl02JRpPsLPjnQkOItPBA Message-ID: Subject: Re: [lang] Advise needed for broken reflectionEquals in WebLogic 10.3.5 From: Paul Benedict To: Commons Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ReflectionEquals uses actual fields, not methods, to build the string output. The underscore is actually a known convention by some Java programmers (I don't subscribe to it but projects like Apache Tapestry use underscore for ALL their fields). So I don't think underscore is suitable to be excluded. However, perhaps as an enhancement the builder could be configured with a list of prefixes to ignore. If that's what you want, please open up a JIRA issue for consideration. On Wed, Jul 27, 2011 at 11:49 AM, Cancrinus, Bas wrote: > I'm currently migrating an EAR from WebLogic 10.3.3 to 10.3.5. While test= ing I noticed that the following invocation returned false while I expected= true (lang 2.5): > > EqualsBuilder.reflectionEquals(Object lhs, Object rhs, String[] excludeFi= elds) > > I noticed in my debugger that my domain classes were extended by the WebL= ogic JPA provider with the following field: > > protected org.eclipse.persistence.queries.FetchGroup _persistence_fetchGr= oup > > EqualsBuilder.reflectionAppend() (lang 2.5-3.0) only ignores: > > - =A0 =A0 =A0 =A0 =A0"$" in field names > > - =A0 =A0 =A0 =A0 =A0static modifiers > > - =A0 =A0 =A0 =A0 =A0transients (conditional) > > - =A0 =A0 =A0 =A0 =A0and of course the excludeFields array > > The JPA extension field mentioned above doesn't fall into any of those ca= tegories, so it is appended to the equals result. > > The easy way out for me would be to add this field to all reflectionEqual= s excludeFields arrays, but I'm looking for a more sustainable way to do th= is. > > - =A0 =A0 =A0 =A0 =A0What do you think about patching EqualsBuilder.refle= ctionAppend() so that it ignores this field ( f.startsWith("_") )? > > - =A0 =A0 =A0 =A0 =A0Are there any other better ways to fix this issue? > > I appreciate any help very much! > > Have a nice day, > Bas > > > P: Please consider the environment before printing this e-mail > > ________________________________ > > This e-mail may contain confidential and privileged material. You are req= uested not to disclose, copy or distribute any information thereof. If you = are not the intended recipient (or have received this e-mail in error) plea= se notify the sender immediately and delete this e-mail. We accept no liabi= lity for damage related to data and/or documents which are communicated by = electronic mail. > > ________________________________ > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org