Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2012-04-24 14:00:54 +0000
committerGreg Wilkins2012-04-24 14:00:54 +0000
commit5e83df20c8842f3da1ccdec7c3152da6b8e5beac (patch)
tree1606cefee6ab8d4f8474f2e9d874e075e8767103 /jetty-annotations
parent107d3a449251c22a1a0e918088a7ab9e2a0c8550 (diff)
downloadorg.eclipse.jetty.project-5e83df20c8842f3da1ccdec7c3152da6b8e5beac.tar.gz
org.eclipse.jetty.project-5e83df20c8842f3da1ccdec7c3152da6b8e5beac.tar.xz
org.eclipse.jetty.project-5e83df20c8842f3da1ccdec7c3152da6b8e5beac.zip
various sonar/findbug code cleanups
Diffstat (limited to 'jetty-annotations')
-rw-r--r--jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java12
-rw-r--r--jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java17
-rw-r--r--jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java6
3 files changed, 13 insertions, 22 deletions
diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java
index 08b47112d3..e837c90ca3 100644
--- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java
+++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java
@@ -16,8 +16,6 @@ package org.eclipse.jetty.annotations;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jetty.util.log.Log;
-
/**
* AnnotationIntrospector
*
@@ -35,7 +33,7 @@ public class AnnotationIntrospector
*/
public interface IntrospectableAnnotationHandler
{
- public void handle(Class clazz);
+ public void handle(Class<?> clazz);
}
@@ -50,7 +48,7 @@ public class AnnotationIntrospector
{
private boolean _introspectAncestors;
- public abstract void doHandle(Class clazz);
+ public abstract void doHandle(Class<?> clazz);
public AbstractIntrospectableAnnotationHandler(boolean introspectAncestors)
@@ -58,9 +56,9 @@ public class AnnotationIntrospector
_introspectAncestors = introspectAncestors;
}
- public void handle(Class clazz)
+ public void handle(Class<?> clazz)
{
- Class c = clazz;
+ Class<?> c = clazz;
//process the whole inheritance hierarchy for the class
while (c!=null && (!c.equals(Object.class)))
@@ -79,7 +77,7 @@ public class AnnotationIntrospector
_handlers.add(handler);
}
- public void introspect (Class clazz)
+ public void introspect (Class<?> clazz)
{
if (_handlers == null)
return;
diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java
index 88209f3bd7..e4b8c8fb16 100644
--- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java
+++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java
@@ -49,7 +49,7 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
* environment that will be looked up at runtime. They do
* not specify an injection.
*/
- public void doHandle(Class clazz)
+ public void doHandle(Class<?> clazz)
{
if (Util.isServletType(clazz))
{
@@ -65,16 +65,13 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
}
}
- public void handleClass (Class clazz)
+ public void handleClass (Class<?> clazz)
{
Resource resource = (Resource)clazz.getAnnotation(Resource.class);
if (resource != null)
{
String name = resource.name();
String mappedName = resource.mappedName();
- Resource.AuthenticationType auth = resource.authenticationType();
- Class type = resource.type();
- boolean shareable = resource.shareable();
if (name==null || name.trim().equals(""))
throw new IllegalStateException ("Class level Resource annotations must contain a name (Common Annotations Spec Section 2.3)");
@@ -92,7 +89,7 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
}
}
- public void handleField(Class clazz, Field field)
+ public void handleField(Class<?> clazz, Field field)
{
Resource resource = (Resource)field.getAnnotation(Resource.class);
if (resource != null)
@@ -118,7 +115,7 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
name = (resource.name()!=null && !resource.name().trim().equals("")? resource.name(): name);
String mappedName = (resource.mappedName()!=null && !resource.mappedName().trim().equals("")?resource.mappedName():null);
//get the type of the Field
- Class type = field.getType();
+ Class<?> type = field.getType();
//Servlet Spec 3.0 p. 76
//If a descriptor has specified at least 1 injection target for this
@@ -207,7 +204,7 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
* This will generate a JNDI entry, and an Injection to be
* processed when an instance of the class is created.
*/
- public void handleMethod(Class clazz, Method method)
+ public void handleMethod(Class<?> clazz, Method method)
{
Resource resource = (Resource)method.getAnnotation(Resource.class);
@@ -265,9 +262,9 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
name = (resource.name()!=null && !resource.name().trim().equals("")? resource.name(): name);
String mappedName = (resource.mappedName()!=null && !resource.mappedName().trim().equals("")?resource.mappedName():null);
- Class paramType = method.getParameterTypes()[0];
+ Class<?> paramType = method.getParameterTypes()[0];
- Class resourceType = resource.type();
+ Class<?> resourceType = resource.type();
//Servlet Spec 3.0 p. 76
//If a descriptor has specified at least 1 injection target for this
diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java
index 2cf7276be0..bfac713b1e 100644
--- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java
+++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java
@@ -35,7 +35,7 @@ public class ResourcesAnnotationHandler extends AbstractIntrospectableAnnotation
_wac = wac;
}
- public void doHandle (Class clazz)
+ public void doHandle (Class<?> clazz)
{
Resources resources = (Resources)clazz.getAnnotation(Resources.class);
if (resources != null)
@@ -49,12 +49,8 @@ public class ResourcesAnnotationHandler extends AbstractIntrospectableAnnotation
for (int j=0;j<resArray.length;j++)
{
-
String name = resArray[j].name();
String mappedName = resArray[j].mappedName();
- Resource.AuthenticationType auth = resArray[j].authenticationType();
- Class type = resArray[j].type();
- boolean shareable = resArray[j].shareable();
if (name==null || name.trim().equals(""))
throw new IllegalStateException ("Class level Resource annotations must contain a name (Common Annotations Spec Section 2.3)");

Back to the top