Skip to content

Commit

Permalink
move InjectGenericLiteral out of InjectGeneric to prevent compilation…
Browse files Browse the repository at this point in the history
… problems
  • Loading branch information
pmuir committed Jul 28, 2010
1 parent 66fefba commit 81a387c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Expand Up @@ -143,20 +143,20 @@ public void redefine(RedefinitionContext<Inject> ctx)
if (ctx.getRawType().equals(genericConfigurationType))
{
// This is a Generic configuration injection point
ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGeneric.INSTANCE);
ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGenericLiteral.INSTANCE);
}
else if (ctx.getAnnotatedElement().isAnnotationPresent(GenericBean.class))
{
// This is a Generic bean injection point
ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGeneric.INSTANCE);
ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGenericLiteral.INSTANCE);
}
else if (ctx.getAnnotatedElement().isAnnotationPresent(GenericProduct.class))
{
/*
* This is an injection point where @GenericProduct has
* been used, so we have to take control of injection
*/
ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGeneric.INSTANCE);
ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGenericLiteral.INSTANCE);
}
}
}
Expand Down
Expand Up @@ -24,8 +24,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.enterprise.util.AnnotationLiteral;

/**
* Annotation used to define generic injection points. @Inject is swapped out
* for @InjectConfiguration on generic beans for any injection points that are controlled by
Expand All @@ -43,15 +41,5 @@
@Retention(RUNTIME)
@Target( { METHOD, FIELD, CONSTRUCTOR })
@interface InjectGeneric
{

static class InjectGenericLiteral extends AnnotationLiteral<InjectGeneric> implements InjectGeneric
{

private static final long serialVersionUID = -1931707390692943775L;

}

static final InjectGeneric INSTANCE = new InjectGenericLiteral();

{
}
@@ -0,0 +1,12 @@
package org.jboss.weld.extensions.bean.generic;

import javax.enterprise.util.AnnotationLiteral;

class InjectGenericLiteral extends AnnotationLiteral<InjectGeneric> implements InjectGeneric
{

private static final long serialVersionUID = -1931707390692943775L;

static final InjectGeneric INSTANCE = new InjectGenericLiteral();

}

0 comments on commit 81a387c

Please sign in to comment.