Author: gavin.king(a)jboss.com
Date: 2008-12-21 00:09:27 -0500 (Sun, 21 Dec 2008)
New Revision: 644
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
Log:
minor
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-21
02:47:01 UTC (rev 643)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-21
05:09:27 UTC (rev 644)
@@ -177,7 +177,6 @@
protected void initDeploymentType()
{
Set<Annotation> deploymentTypes =
getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
-
if (deploymentTypes.size() > 1)
{
throw new DefinitionException("At most one deployment type may be specified
(" + deploymentTypes + " are specified) on " +
getAnnotatedItem().toString());
@@ -189,9 +188,10 @@
return;
}
- if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
+ AnnotationMap possibleDeploymentTypes =
getMergedStereotypes().getPossibleDeploymentTypes();
+ if (possibleDeploymentTypes.size() > 0)
{
- this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(),
getMergedStereotypes().getPossibleDeploymentTypes());
+ this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(),
possibleDeploymentTypes);
log.trace("Deployment type " + deploymentType + " specified by
stereotype");
return;
}
@@ -269,25 +269,26 @@
*/
protected void initScopeType()
{
- if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() > 1)
+ Set<Annotation> scopeAnnotations =
getAnnotatedItem().getMetaAnnotations(ScopeType.class);
+ if (scopeAnnotations.size() > 1)
{
throw new DefinitionException("At most one scope may be specified");
}
-
- if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() == 1)
+ if (scopeAnnotations.size() == 1)
{
- this.scopeType =
getAnnotatedItem().getMetaAnnotations(ScopeType.class).iterator().next().annotationType();
+ this.scopeType = scopeAnnotations.iterator().next().annotationType();
log.trace("Scope " + scopeType + " specified by
annotation");
return;
}
- if (getMergedStereotypes().getPossibleScopeTypes().size() == 1)
+ Set<Annotation> possibleScopeTypes =
getMergedStereotypes().getPossibleScopeTypes();
+ if (possibleScopeTypes.size() == 1)
{
- this.scopeType =
getMergedStereotypes().getPossibleScopeTypes().iterator().next().annotationType();
+ this.scopeType = possibleScopeTypes.iterator().next().annotationType();
log.trace("Scope " + scopeType + " specified by
stereotype");
return;
}
- else if (getMergedStereotypes().getPossibleScopeTypes().size() > 1)
+ else if (possibleScopeTypes.size() > 1)
{
throw new DefinitionException("All stereotypes must specify the same scope
OR a scope must be specified on the bean");
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-21
02:47:01 UTC (rev 643)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-21
05:09:27 UTC (rev 644)
@@ -77,7 +77,6 @@
/**
* Initializes the bean and its metadata
*/
- @SuppressWarnings("unchecked")
@Override
protected void init()
{
@@ -260,7 +259,6 @@
*
* @return The instance
*/
- @SuppressWarnings("unchecked")
@Override
public T create()
{
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-12-21
02:47:01 UTC (rev 643)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-12-21
05:09:27 UTC (rev 644)
@@ -68,7 +68,7 @@
* @return The EJB reference
*/
@SuppressWarnings("unchecked")
- public static <T> T lookup(EjbDescriptor<T> ejbDescriptor)
+ public <T> T lookup(EjbDescriptor<T> ejbDescriptor)
{
try
{