Return-Path: X-Original-To: apmail-openejb-commits-archive@www.apache.org Delivered-To: apmail-openejb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 557868EDF for ; Mon, 8 Aug 2011 09:38:45 +0000 (UTC) Received: (qmail 16383 invoked by uid 500); 8 Aug 2011 09:38:44 -0000 Delivered-To: apmail-openejb-commits-archive@openejb.apache.org Received: (qmail 16018 invoked by uid 500); 8 Aug 2011 09:38:37 -0000 Mailing-List: contact commits-help@openejb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openejb.apache.org Delivered-To: mailing list commits@openejb.apache.org Received: (qmail 15460 invoked by uid 99); 8 Aug 2011 09:38:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 09:38:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 09:38:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9D75823888CE for ; Mon, 8 Aug 2011 09:38:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1154891 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java Date: Mon, 08 Aug 2011 09:38:08 -0000 To: commits@openejb.apache.org From: rmannibucau@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110808093808.9D75823888CE@eris.apache.org> Author: rmannibucau Date: Mon Aug 8 09:38:08 2011 New Revision: 1154891 URL: http://svn.apache.org/viewvc?rev=1154891&view=rev Log: fixing bad test to avoid exception Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java?rev=1154891&r1=1154890&r2=1154891&view=diff ============================================================================== --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java (original) +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java Mon Aug 8 09:38:08 2011 @@ -736,10 +736,14 @@ public class AnnotationDeployer implemen } javax.resource.spi.ConfigProperty annotation = propertyDescriptor.getWriteMethod().getAnnotation(javax.resource.spi.ConfigProperty.class); - if (annotation == null && clazz.getDeclaredField(name) != null) { - // if there's no annotation on the setter, we'll try and scrape one off the field itself (assuming the same name) - annotation = clazz.getDeclaredField(name).getAnnotation(javax.resource.spi.ConfigProperty.class); - } + if (annotation == null) { + try { + // if there's no annotation on the setter, we'll try and scrape one off the field itself (assuming the same name) + annotation = clazz.getDeclaredField(name).getAnnotation(javax.resource.spi.ConfigProperty.class); + } catch (Exception ignored) { + // no-op : getDeclaredField() throws exceptions and does not return null + } + } configProperty.setConfigPropertyName(name); configProperty.setConfigPropertyType(getConfigPropertyType(annotation, type));