Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C49E7200CA8 for ; Thu, 15 Jun 2017 23:50:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C35D6160BDF; Thu, 15 Jun 2017 21:50:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 13D31160BC9 for ; Thu, 15 Jun 2017 23:50:23 +0200 (CEST) Received: (qmail 17080 invoked by uid 500); 15 Jun 2017 21:50:23 -0000 Mailing-List: contact commits-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwebbeans.apache.org Delivered-To: mailing list commits@openwebbeans.apache.org Received: (qmail 17059 invoked by uid 99); 15 Jun 2017 21:50:22 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2017 21:50:22 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 5BFE33A0350 for ; Thu, 15 Jun 2017 21:50:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1798884 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/creation/BeanAttributesBuilder.java util/WebBeansUtil.java Date: Thu, 15 Jun 2017 21:50:19 -0000 To: commits@openwebbeans.apache.org From: struberg@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170615215021.5BFE33A0350@svn01-us-west.apache.org> archived-at: Thu, 15 Jun 2017 21:50:25 -0000 Author: struberg Date: Thu Jun 15 21:50:18 2017 New Revision: 1798884 URL: http://svn.apache.org/viewvc?rev=1798884&view=rev Log: OWB-1182 review isManagedBean criteria TCK has some weird failure checks which need to blow up in a very specific way... Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java?rev=1798884&r1=1798883&r2=1798884&view=diff ============================================================================== --- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java (original) +++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java Thu Jun 15 21:50:18 2017 @@ -19,7 +19,9 @@ package org.apache.webbeans.component.creation; import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.lang.reflect.Type; import java.util.Collections; import java.util.HashSet; @@ -202,7 +204,8 @@ public abstract class BeanAttributesBuil /** * {@inheritDoc} */ - protected void defineQualifiers() + protected void + defineQualifiers() { HashSet> qualifiedTypes = new HashSet>(); if (annotated.isAnnotationPresent(Specializes.class)) @@ -469,10 +472,22 @@ public abstract class BeanAttributesBuil scope = Dependent.class; } } + if (scope == null) + { + if (annotated instanceof AnnotatedType) + { + Constructor defaultCt = webBeansContext.getWebBeansUtil().getNoArgConstructor(((AnnotatedType) annotated).getJavaClass()); + if (defaultCt != null && Modifier.isPrivate(defaultCt.getModifiers())) + { + // basically ignore this class by not adding a scope + return; + } + } + } if (scope == null && - (!onlyScopedBeans || - annotated.getAnnotation(Interceptor.class) != null || - annotated.getAnnotation(Decorator.class) != null)) + (!onlyScopedBeans || + annotated.getAnnotation(Interceptor.class) != null || + annotated.getAnnotation(Decorator.class) != null)) { // only add a 'default' Dependent scope // * if it's not in a bean-discovery-mode='scoped' module, or Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1798884&r1=1798883&r2=1798884&view=diff ============================================================================== --- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original) +++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Thu Jun 15 21:50:18 2017 @@ -398,9 +398,8 @@ public final class WebBeansUtil Class clazz = annotatedType.getJavaClass(); Constructor defaultCt = getNoArgConstructor(clazz); - if (defaultCt != null && !Modifier.isPrivate(defaultCt.getModifiers())) + if (defaultCt != null ) { - // if we have an accessible default ct, then all is fine in any case return true; }