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 08b47112d3f..e837c90ca32 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 88209f3bd7e..e4b8c8fb16c 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 2cf7276be03..bfac713b1ee 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;j0) { long before=now; - selected=selector.select(wait); + selector.select(wait); now = System.currentTimeMillis(); _timeout.setNow(now); diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java index fc269ccfab2..2c93f594a2f 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java @@ -354,6 +354,7 @@ public class DataSourceLoginService extends MappedLoginService @SuppressWarnings("unused") InitialContext ic = new InitialContext(); + assert ic!=null; //TODO webapp scope? diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java index 2c269900811..5e9bdbb0e90 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java @@ -139,11 +139,9 @@ public class IntrospectionUtil public static boolean checkParams (Class[] formalParams, Class[] actualParams, boolean strict) { - if (formalParams==null && actualParams==null) - return true; - if (formalParams==null && actualParams!=null) - return false; - if (formalParams!=null && actualParams==null) + if (formalParams==null) + return actualParams==null; + if (actualParams==null) return false; if (formalParams.length!=actualParams.length) @@ -195,13 +193,11 @@ public class IntrospectionUtil public static boolean isTypeCompatible (Class formalType, Class actualType, boolean strict) { - if (formalType==null && actualType != null) + if (formalType==null) + return actualType==null; + if (actualType==null) return false; - if (formalType!=null && actualType==null) - return false; - if (formalType==null && actualType==null) - return true; - + if (strict) return formalType.equals(actualType); else diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java index c97f07f91aa..36973f673e6 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java @@ -290,25 +290,26 @@ public class URLResource extends Resource @Override public int hashCode() { - return _url.hashCode(); + return _urlString.hashCode(); } /* ------------------------------------------------------------ */ @Override public boolean equals( Object o) { - return o instanceof URLResource && - _url.equals(((URLResource)o)._url); + return o instanceof URLResource && _urlString.equals(((URLResource)o)._urlString); } + /* ------------------------------------------------------------ */ public boolean getUseCaches () { return _useCaches; } - + + /* ------------------------------------------------------------ */ @Override public boolean isContainedIn (Resource containingResource) throws MalformedURLException { - return false; //TODO gregw check this! + return false; //TODO check this! } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java index 5adda2233a8..a4b096fe8cf 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java @@ -106,7 +106,8 @@ public class TagLibConfiguration extends AbstractConfiguration //Get the system classpath tlds and tell jasper about them, if jasper is on the classpath try { - Class clazz = getClass().getClassLoader().loadClass("org.apache.jasper.compiler.TldLocationsCache"); + Class clazz = getClass().getClassLoader().loadClass("org.apache.jasper.compiler.TldLocationsCache"); + assert clazz!=null; Collection tld_resources = (Collection)_context.getAttribute(TLD_RESOURCES); Map> tldMap = new HashMap>();