openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1434693 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: annotation/AnnotationManager.java annotation/DefaultLiteral.java inject/InjectableMethod.java util/AnnotationUtil.java
Date Thu, 17 Jan 2013 14:41:56 GMT
Author: struberg
Date: Thu Jan 17 14:41:56 2013
New Revision: 1434693

URL: http://svn.apache.org/viewvc?rev=1434693&view=rev
Log:
OWB-344 introduce statid DefaultLiteral instance

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/DefaultLiteral.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethod.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java?rev=1434693&r1=1434692&r2=1434693&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
Thu Jan 17 14:41:56 2013
@@ -68,7 +68,7 @@ public final class AnnotationManager
     private final static Annotation[] ONLY_DEFAULT_ANNOTATION = new Annotation[1];
     static
     {
-        ONLY_DEFAULT_ANNOTATION[0] = new DefaultLiteral();
+        ONLY_DEFAULT_ANNOTATION[0] = DefaultLiteral.INSTANCE;
     }
 
     // No instantiate

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/DefaultLiteral.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/DefaultLiteral.java?rev=1434693&r1=1434692&r2=1434693&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/DefaultLiteral.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/DefaultLiteral.java
Thu Jan 17 14:41:56 2013
@@ -27,6 +27,8 @@ import javax.enterprise.inject.Default;
  */
 public class DefaultLiteral extends EmptyAnnotationLiteral<Default> implements Default
 {
+    public static final DefaultLiteral INSTANCE = new DefaultLiteral();
+
     private static final String TOSTRING = "@javax.enterprise.inject.Default()";
     private static final long serialVersionUID = 6788272256977634238L;
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethod.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethod.java?rev=1434693&r1=1434692&r2=1434693&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethod.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethod.java
Thu Jan 17 14:41:56 2013
@@ -91,7 +91,7 @@ public class InjectableMethod<T> extends
                         if(parameter.getBaseType().equals(InjectionPoint.class))
                         {
                             BeanManager manager = getWebBeansContext().getBeanManagerImpl();
-                            Bean<?> injectionPointBean = manager.getBeans(InjectionPoint.class,
new DefaultLiteral()).iterator().next();
+                            Bean<?> injectionPointBean = manager.getBeans(InjectionPoint.class,
DefaultLiteral.INSTANCE).iterator().next();
                             Object reference = manager.getReference(injectionPointBean, InjectionPoint.class,
manager.createCreationalContext(injectionPointBean));
 
                             dependentParameters.put(injectionPointBean, reference);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=1434693&r1=1434692&r2=1434693&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
Thu Jan 17 14:41:56 2013
@@ -49,7 +49,7 @@ public final class AnnotationUtil
 
     public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
     
-    public static final Set<Annotation> DEFAULT_AND_ANY_ANNOTATION = Collections.unmodifiableSet(new
HashSet<Annotation>(Arrays.asList(new DefaultLiteral(), new AnyLiteral())));
+    public static final Set<Annotation> DEFAULT_AND_ANY_ANNOTATION = Collections.unmodifiableSet(new
HashSet<Annotation>(Arrays.asList(DefaultLiteral.INSTANCE, new AnyLiteral())));
 
     // No instantiate
     private AnnotationUtil()



Mime
View raw message