Skip to content
This repository has been archived by the owner on May 28, 2018. It is now read-only.

Commit

Permalink
GLASSFISH-21110: cdi tck failures caused by Jersey
Browse files Browse the repository at this point in the history
 fix confirmed by JJ

Change-Id: Iaaa64b7608a706e559e63c6196b5ff36f790ac79
Signed-off-by: Jakub Podlesak <[email protected]>
  • Loading branch information
japod authored and Michal Gajdos committed Jun 30, 2014
1 parent f7e14df commit b92a063
Showing 1 changed file with 57 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,57 +568,74 @@ private void processAnnotatedType(@Observes final ProcessAnnotatedType processAn
jerseyVetoedTypes.add(baseType);
}
}
processAnnotatedType.setAnnotatedType(new AnnotatedType(){

@Override
public Class getJavaClass() {
return annotatedType.getJavaClass();
}
if (containsJaxRsParameterizedCtor(annotatedType)) {

@Override
public Set<AnnotatedConstructor> getConstructors() {
Set<AnnotatedConstructor> result = new HashSet<AnnotatedConstructor>();
for (AnnotatedConstructor c : (Set<AnnotatedConstructor>)annotatedType.getConstructors()) {
result.add(enrichedConstructor(c));
processAnnotatedType.setAnnotatedType(new AnnotatedType() {

@Override
public Class getJavaClass() {
return annotatedType.getJavaClass();
}
return result;
}

@Override
public Set getMethods() {
return annotatedType.getMethods();
}
@Override
public Set<AnnotatedConstructor> getConstructors() {
Set<AnnotatedConstructor> result = new HashSet<AnnotatedConstructor>();
for (AnnotatedConstructor c : (Set<AnnotatedConstructor>) annotatedType.getConstructors()) {
result.add(enrichedConstructor(c));
}
return result;
}

@Override
public Set getFields() {
return annotatedType.getFields();
}
@Override
public Set getMethods() {
return annotatedType.getMethods();
}

@Override
public Type getBaseType() {
return annotatedType.getBaseType();
}
@Override
public Set getFields() {
return annotatedType.getFields();
}

@Override
public Set<Type> getTypeClosure() {
return annotatedType.getTypeClosure();
}
@Override
public Type getBaseType() {
return annotatedType.getBaseType();
}

@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
return annotatedType.getAnnotation(annotationType);
}
@Override
public Set<Type> getTypeClosure() {
return annotatedType.getTypeClosure();
}

@Override
public Set<Annotation> getAnnotations() {
return annotatedType.getAnnotations();
}
@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
return annotatedType.getAnnotation(annotationType);
}

@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
return annotatedType.isAnnotationPresent(annotationType);
@Override
public Set<Annotation> getAnnotations() {
return annotatedType.getAnnotations();
}

@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
return annotatedType.isAnnotationPresent(annotationType);
}
});
}
}

private boolean containsJaxRsParameterizedCtor(AnnotatedType annotatedType) {
for (AnnotatedConstructor<?> c : (Set<AnnotatedConstructor>) annotatedType.getConstructors()) {
for (AnnotatedParameter<?> p : c.getParameters()) {
for (Class<? extends Annotation> a : JaxRsParamProducer.JaxRsParamAnnotationTYPES) {
if(p.isAnnotationPresent(a)) {
return true;
}
}
}
});
}
return false;
}

@SuppressWarnings("unused")
Expand Down

0 comments on commit b92a063

Please sign in to comment.