aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-02-22 13:04:45 (EST)
committerJesse McConnell2012-02-22 15:42:11 (EST)
commit8de385992e3c1821b826c132f9e8d2b171b1b56e (patch)
tree918fe05f472e90e17186231c988ebc51a5b95496
parent19fae56d6d5bf1f443fe26ce17399d65cd894afa (diff)
downloadorg.eclipse.jetty.project-8de385992e3c1821b826c132f9e8d2b171b1b56e.zip
org.eclipse.jetty.project-8de385992e3c1821b826c132f9e8d2b171b1b56e.tar.gz
org.eclipse.jetty.project-8de385992e3c1821b826c132f9e8d2b171b1b56e.tar.bz2
372256: fix if clause doing an || instead of && and thus always calling instanceOf on null values
-rw-r--r--jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
index 60ff124..2d66c28 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
@@ -576,6 +576,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
* @return Returns the Override Descriptor.
* @deprecated use {@link #getOverrideDescriptors()}
*/
+ @Deprecated
public String getOverrideDescriptor()
{
if (_overrideDescriptors.size()!=1)
@@ -687,20 +688,26 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
private void loadServerClasses()
{
if (_serverClasses != null)
+ {
return;
+ }
- //look for a Server attribute with the list of Server classes
- //to apply to every web application. If not present, use our defaults.
+ // look for a Server attribute with the list of Server classes
+ // to apply to every web application. If not present, use our defaults.
Server server = getServer();
if (server != null)
{
Object serverClasses = server.getAttribute(SERVER_SRV_CLASSES);
- if (serverClasses != null || serverClasses instanceof String[])
+ if (serverClasses != null && serverClasses instanceof String[])
+ {
_serverClasses = new ClasspathPattern((String[])serverClasses);
+ }
}
if (_serverClasses == null)
+ {
_serverClasses = new ClasspathPattern(__dftServerClasses);
+ }
}
/* ------------------------------------------------------------ */
@@ -874,6 +881,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
* @param overrideDescriptor The overrideDescritpor to set.
* @deprecated use {@link #setOverrideDescriptors(List)}
*/
+ @Deprecated
public void setOverrideDescriptor(String overrideDescriptor)
{
_overrideDescriptors.clear();
@@ -961,7 +969,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
@Override
public void addEventListener(EventListener listener)
{
- setEventListeners((EventListener[])LazyList.addToArray(getEventListeners(), listener, EventListener.class));
+ setEventListeners(LazyList.addToArray(getEventListeners(), listener, EventListener.class));
}
@@ -1218,6 +1226,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
public class Context extends ServletContextHandler.Context
{
/* ------------------------------------------------------------ */
+ @Override
public URL getResource(String path) throws MalformedURLException
{
Resource resource=WebAppContext.this.getResource(path);