Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49758
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 22 Aug 2010 23:11:18 +0000 (23:11 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 22 Aug 2010 23:11:18 +0000 (23:11 +0000)
Fix generics warnings exposed by a fix in Eclipse 3.6. Patch provided by sebb.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@987958 13f79535-47bb-0310-9956-ffa450edef68

18 files changed:
java/javax/annotation/Resource.java
java/javax/ejb/EJB.java
java/javax/el/BeanELResolver.java
java/javax/el/ELContext.java
java/javax/el/ResourceBundleELResolver.java
java/javax/servlet/ServletRequestWrapper.java
java/javax/servlet/ServletResponseWrapper.java
java/javax/servlet/annotation/HandlesTypes.java
java/javax/servlet/jsp/el/ExpressionEvaluator.java
java/javax/servlet/jsp/el/ImplicitObjectELResolver.java
java/javax/servlet/jsp/tagext/TagSupport.java
java/javax/xml/ws/WebServiceRef.java
java/org/apache/el/lang/EvaluationContext.java
java/org/apache/el/parser/AstValue.java
java/org/apache/jasper/el/ELContextWrapper.java
java/org/apache/jasper/el/ExpressionEvaluatorImpl.java
java/org/apache/naming/resources/DirContextURLConnection.java
webapps/docs/changelog.xml

index bc3bd70..21a5d8b 100644 (file)
@@ -32,7 +32,7 @@ public @interface Resource {
         APPLICATION
     }
     public String name() default "";
-    @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
+    @SuppressWarnings("rawtypes") // Can't use Class<?> because API needs to match specification
     public Class type() default Object.class;
     public AuthenticationType authenticationType() default AuthenticationType.CONTAINER;
     public boolean shareable() default true;
index 8e31ad8..85233ed 100644 (file)
@@ -29,7 +29,7 @@ import java.lang.annotation.Target;
 public @interface EJB {
    String name() default "";
    String description() default "";
-   @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
+   @SuppressWarnings("rawtypes") // Can't use Class<?> because API needs to match specification
    Class beanInterface() default java.lang.Object.class;
    String beanName() default "";
    String mappedName() default "";
index e7c01b0..dacb205 100644 (file)
@@ -231,7 +231,7 @@ public class BeanELResolver extends ELResolver {
         }
 
         // Can't use Class<?> because API needs to match specification
-        public @SuppressWarnings("unchecked") Class getPropertyType() {
+        public @SuppressWarnings("rawtypes") Class getPropertyType() {
             return this.type;
         }
 
index f06b874..1cdf5c7 100644 (file)
@@ -40,7 +40,7 @@ public abstract class ELContext {
     }
     
     // Can't use Class<?> because API needs to match specification
-    public Object getContext(@SuppressWarnings("unchecked") Class key) {
+    public Object getContext(@SuppressWarnings("rawtypes") Class key) {
         if (this.map == null) {
             return null;
         }
@@ -48,7 +48,7 @@ public abstract class ELContext {
     }
     
     // Can't use Class<?> because API needs to match specification
-    public void putContext(@SuppressWarnings("unchecked") Class key,
+    public void putContext(@SuppressWarnings("rawtypes") Class key,
             Object contextObject) throws NullPointerException {
         if (key == null || contextObject == null) {
             throw new NullPointerException();
index c75ac73..6e41b59 100644 (file)
@@ -101,7 +101,7 @@ public class ResourceBundleELResolver extends ELResolver {
 
     @Override
     // Can't use Iterator<FeatureDescriptor> because API needs to match specification
-    public @SuppressWarnings("unchecked") Iterator getFeatureDescriptors(
+    public @SuppressWarnings({ "unchecked", "rawtypes" }) Iterator getFeatureDescriptors(
             ELContext context, Object base) {
         if (base instanceof ResourceBundle) {
             List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>();
index a83b8c2..88b799c 100644 (file)
@@ -432,7 +432,7 @@ public class ServletRequestWrapper implements ServletRequest {
      */
     @SuppressWarnings("unchecked")
     // Spec API does not use generics
-    public boolean isWrapperFor(Class wrappedType) {
+    public boolean isWrapperFor(@SuppressWarnings("rawtypes") Class wrappedType) {
         if (wrappedType.isAssignableFrom(request.getClass())) {
             return true;
         }
index b0f0dd3..335d322 100644 (file)
@@ -226,7 +226,7 @@ public class ServletResponseWrapper implements ServletResponse {
      */
     @SuppressWarnings("unchecked")
     // Spec API does not use generics
-    public boolean isWrapperFor(Class wrappedType) {
+    public boolean isWrapperFor(@SuppressWarnings("rawtypes") Class wrappedType) {
         if (wrappedType.isAssignableFrom(response.getClass())) {
             return true;
         }
index 4818f4f..f1ff122 100644 (file)
@@ -29,7 +29,7 @@ import java.lang.annotation.Target;
  */
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@SuppressWarnings("unchecked") // Spec API does not use generics
+@SuppressWarnings("rawtypes") // Spec API does not use generics
 public @interface HandlesTypes {
 
     /**
index 6610fcb..785c6f8 100644 (file)
@@ -83,7 +83,7 @@ public abstract class ExpressionEvaluator {
      *                Thrown if parsing errors were found.
      */
     public abstract Expression parseExpression(String expression,
-            @SuppressWarnings("unchecked")// TCK signature fails with generics
+            @SuppressWarnings("rawtypes")// TCK signature fails with generics
             Class expectedType, FunctionMapper fMapper) throws ELException;
 
     /**
@@ -109,7 +109,7 @@ public abstract class ExpressionEvaluator {
      */
     public abstract Object evaluate(
             String expression,
-            @SuppressWarnings("unchecked")// TCK signature fails with generics
+            @SuppressWarnings("rawtypes")// TCK signature fails with generics
             Class expectedType, VariableResolver vResolver,
             FunctionMapper fMapper) throws ELException;
 }
index 7eae3ed..9dea1f6 100644 (file)
@@ -121,7 +121,7 @@ public class ImplicitObjectELResolver extends ELResolver {
     }
 
     @Override
-    @SuppressWarnings("unchecked") // TCK signature test fails with generics
+    @SuppressWarnings({ "unchecked", "rawtypes" }) // TCK signature test fails with generics
     public Class getType(ELContext context, Object base, Object property)
             throws NullPointerException, PropertyNotFoundException, ELException {
         if (context == null) {
index 51d1c0a..709ecbd 100644 (file)
@@ -73,7 +73,7 @@ public class TagSupport implements IterationTag, Serializable {
      */
     public static final Tag findAncestorWithClass(Tag from,
             // TCK signature test fails with generics
-            @SuppressWarnings("unchecked")
+            @SuppressWarnings("rawtypes")
             Class klass) {
         boolean isInterface = false;
 
index f967335..6d0d389 100644 (file)
@@ -28,9 +28,9 @@ import java.lang.annotation.Target;
 
 public @interface WebServiceRef {
     public String name() default "";
-    @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
+    @SuppressWarnings("rawtypes") // Can't use Class<?> because API needs to match specification
     public Class type() default java.lang.Object.class;
-    @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
+    @SuppressWarnings("rawtypes") // Can't use Class<?> because API needs to match specification
     public Class value() default java.lang.Object.class;
     public String wsdlLocation() default "";
     public String mappedName() default "";
index cc5827d..412f049 100644 (file)
@@ -55,7 +55,7 @@ public final class EvaluationContext extends ELContext {
 
     @Override
     // Can't use Class<?> because API needs to match specification in superclass
-    public Object getContext(@SuppressWarnings("unchecked") Class key) {
+    public Object getContext(@SuppressWarnings("rawtypes") Class key) {
         return this.elContext.getContext(key);
     }
 
@@ -71,7 +71,7 @@ public final class EvaluationContext extends ELContext {
 
     @Override
     // Can't use Class<?> because API needs to match specification in superclass
-    public void putContext(@SuppressWarnings("unchecked") Class key,
+    public void putContext(@SuppressWarnings("rawtypes") Class key,
             Object contextObject) {
         this.elContext.putContext(key, contextObject);
     }
index da39db1..02ad92f 100644 (file)
@@ -227,7 +227,7 @@ public final class AstValue extends SimpleNode {
     @Override
     // Interface el.parser.Node uses raw types (and is auto-generated)
     public MethodInfo getMethodInfo(EvaluationContext ctx, 
-            @SuppressWarnings("unchecked") Class[] paramTypes)
+            @SuppressWarnings("rawtypes") Class[] paramTypes)
             throws ELException {
         Target t = getTarget(ctx);
         Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
@@ -238,7 +238,7 @@ public final class AstValue extends SimpleNode {
     @Override
     // Interface el.parser.Node uses a raw type (and is auto-generated)
     public Object invoke(EvaluationContext ctx, 
-            @SuppressWarnings("unchecked") Class[] paramTypes,
+            @SuppressWarnings("rawtypes") Class[] paramTypes,
             Object[] paramValues) throws ELException {
         
         Target t = getTarget(ctx);
index d342db0..bf8fca3 100644 (file)
@@ -55,7 +55,7 @@ public final class ELContextWrapper extends ELContext {
     }
 
     @Override
-    @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match super-class specification
+    @SuppressWarnings("rawtypes") // Can't use Class<?> because API needs to match super-class specification
     public Object getContext(Class key) {
         return this.target.getContext(key);
     }
@@ -71,7 +71,7 @@ public final class ELContextWrapper extends ELContext {
     }
 
     @Override
-    @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match super-class specification
+    @SuppressWarnings("rawtypes") // Can't use Class<?> because API needs to match super-class specification
     public void putContext(Class key, Object contextObject) throws NullPointerException {
         this.target.putContext(key, contextObject);
     }
index d3fbf8a..b27dc7e 100644 (file)
@@ -36,7 +36,7 @@ public final class ExpressionEvaluatorImpl extends ExpressionEvaluator {
 
     @Override
     public Expression parseExpression(String expression,
-            @SuppressWarnings("unchecked") // API does not use generics
+            @SuppressWarnings("rawtypes") // API does not use generics
             Class expectedType,
             FunctionMapper fMapper) throws ELException {
         try {
@@ -54,7 +54,7 @@ public final class ExpressionEvaluatorImpl extends ExpressionEvaluator {
 
     @Override
     public Object evaluate(String expression,
-            @SuppressWarnings("unchecked") // API does not use generics
+            @SuppressWarnings("rawtypes") // API does not use generics
             Class expectedType,
             VariableResolver vResolver, FunctionMapper fMapper)
             throws ELException {
index 1af14d2..e676221 100644 (file)
@@ -350,7 +350,7 @@ public class DirContextURLConnection
     /**
      * Get object content.
      */
-    @SuppressWarnings("unchecked") // overridden method uses raw type Class[]
+    @SuppressWarnings("rawtypes") // overridden method uses raw type Class[]
     @Override
     public Object getContent(Class[] classes)
         throws IOException {
index c174620..8577868 100644 (file)
       <add>
         Extend Checkstyle validation checks to check import order. (markt) 
       </add>
+      <fix>
+        <bug>49758</bug>: Fix generics warnings exposed by a fix in Eclipse 3.6.
+        Patch provided by sebb. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>