package javax.webbeans;

public class DynamicBinding<T>
{

}

@@ -22,40 +22,1122 @@
 s;%0A%0A
-public class DynamicBinding%3CT%3E%0A%7B%0A
+import java.lang.annotation.Annotation;%0Aimport java.lang.reflect.ParameterizedType;%0Aimport java.lang.reflect.Type;%0A%0Apublic abstract class DynamicBinding%3CT extends Annotation%3E implements Annotation%0A%7B%0A%0A   private Class%3CT%3E annotationType;%0A   %0A   @SuppressWarnings(%22unchecked%22)%0A   public DynamicBinding()%0A   %7B%0A      Type type = getClass().getGenericSuperclass();%0A      if (type instanceof ParameterizedType)%0A      %7B%0A         ParameterizedType parameterizedType = (ParameterizedType) type;%0A         if (parameterizedType.getActualTypeArguments().length == 1)%0A         %7B%0A            annotationType = (Class%3CT%3E) parameterizedType.getActualTypeArguments()%5B0%5D;%0A         %7D%0A      %7D%0A      if (annotationType == null)%0A      %7B%0A         throw new RuntimeException(%22Unable to determine type of dynamic binding%22);%0A      %7D%0A   %7D%0A   %0A   public Class%3C? extends Annotation%3E annotationType()%0A   %7B%0A      return annotationType;%0A   %7D%0A   %0A   @Override%0A   public String toString()%0A   %7B%0A      // TODO Make this closer to the spec for Annotation%0A      String annotationName = %22@%22 + annotationType.getName();%0A      return annotationName;%0A   %7D%0A   
 %0A%7D%0A

Correct implementation of annotationType() for DynamicBinding