diff --git a/header-template.txt b/header-template.txt
new file mode 100644
index 00000000000..3163f16b175
--- /dev/null
+++ b/header-template.txt
@@ -0,0 +1,15 @@
+ ========================================================================
+ Copyright (c) ${copyright-range} Mort Bay Consulting Pty. Ltd.
+ ------------------------------------------------------------------------
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ and Apache License v2.0 which accompanies this distribution.
+
+ The Eclipse Public License is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ The Apache License v2.0 is available at
+ http://www.opensource.org/licenses/apache2.0.php
+
+ You may elect to redistribute this code under either of these licenses.
+========================================================================
\ No newline at end of file
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
index 322d43f82ab..59c0280b80d 100644
--- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
+++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
@@ -587,6 +587,55 @@ public class HttpURI
return new String(_raw,_path,length,_charset);
return new String(bytes,0,n,_charset);
}
+
+
+ public String getDecodedPath(String encoding)
+ {
+ if (_path==_param)
+ return null;
+
+ int length = _param-_path;
+ byte[] bytes=null;
+ int n=0;
+
+ for (int i=_path;i<_param;i++)
+ {
+ byte b = _raw[i];
+
+ if (b=='%')
+ {
+ if ((i+2)>=_param)
+ throw new IllegalArgumentException("Bad % encoding: "+this);
+ b=(byte)(0xff&TypeUtil.parseInt(_raw,i+1,2,16));
+ i+=2;
+ }
+ else if (bytes==null)
+ {
+ n++;
+ continue;
+ }
+
+ if (bytes==null)
+ {
+ bytes=new byte[length];
+ System.arraycopy(_raw,_path,bytes,0,n);
+ }
+
+ bytes[n++]=b;
+ }
+
+
+ if (bytes==null)
+ return StringUtil.toString(_raw,_path,_param-_path,encoding);
+
+ return StringUtil.toString(bytes,0,n,encoding);
+ }
+
+
+
+
+
+
public String getPathAndParam()
{
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
index 0baeef255bc..262b40dceec 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
@@ -23,8 +23,11 @@ import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
import org.eclipse.jetty.security.authentication.DeferredAuthentication;
+import org.eclipse.jetty.server.AbstractHttpConnection;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
@@ -33,6 +36,7 @@ import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.ContextHandler.Context;
import org.eclipse.jetty.server.handler.HandlerWrapper;
+import org.eclipse.jetty.server.session.AbstractSessionManager;
import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -285,6 +289,32 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
getInitParameter(name)==null)
setInitParameter(name,context.getInitParameter(name));
}
+
+ //register a session listener to handle securing sessions when authentication is performed
+ context.getContextHandler().addEventListener(new HttpSessionListener()
+ {
+
+ public void sessionDestroyed(HttpSessionEvent se)
+ {
+
+ }
+
+ public void sessionCreated(HttpSessionEvent se)
+ {
+ //if current request is authenticated, then as we have just created the session, mark it as secure, as it has not yet been returned to a user
+ AbstractHttpConnection connection = AbstractHttpConnection.getCurrentConnection();
+ if (connection == null)
+ return;
+ Request request = connection.getRequest();
+ if (request == null)
+ return;
+
+ if (request.isSecure())
+ {
+ se.getSession().setAttribute(AbstractSessionManager.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
+ }
+ }
+ });
}
// complicated resolution of login and identity service to handle
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java
index dec0ee78d1c..81dfcb43607 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java
@@ -83,7 +83,7 @@ public class BasicAuthenticator extends LoginAuthenticator
UserIdentity user = _loginService.login(username,password);
if (user!=null)
{
- renewSessionOnAuthentication(request,response);
+ renewSession(request,response);
return new UserAuthentication(getAuthMethod(),user);
}
}
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java
index 25220375506..67eba6034b8 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java
@@ -119,7 +119,7 @@ public class ClientCertAuthenticator extends LoginAuthenticator
UserIdentity user = _loginService.login(username,credential);
if (user!=null)
{
- renewSessionOnAuthentication(request,response);
+ renewSession(request,response);
return new UserAuthentication(getAuthMethod(),user);
}
}
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java
index 505831963bb..73cfc100a26 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java
@@ -183,7 +183,7 @@ public class DigestAuthenticator extends LoginAuthenticator
UserIdentity user = _loginService.login(digest.username,digest);
if (user!=null)
{
- renewSessionOnAuthentication(request,response);
+ renewSession(request,response);
return new UserAuthentication(getAuthMethod(),user);
}
}
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java
index 26196b71199..ab182b9bc55 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java
@@ -189,8 +189,8 @@ public class FormAuthenticator extends LoginAuthenticator
if (!mandatory)
return _deferred;
- if (isLoginOrErrorPage(URIUtil.addPaths(request.getServletPath(),request.getPathInfo())))
- return Authentication.NOT_CHECKED;
+ if (isLoginOrErrorPage(URIUtil.addPaths(request.getServletPath(),request.getPathInfo())) &&!DeferredAuthentication.isDeferred(response))
+ return _deferred;
HttpSession session = request.getSession(true);
@@ -205,7 +205,7 @@ public class FormAuthenticator extends LoginAuthenticator
UserIdentity user = _loginService.login(username,password);
if (user!=null)
{
- session=renewSessionOnAuthentication(request,response);
+ session=renewSession(request,response);
// Redirect to original request
String nuri;
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java
index c730a9bab5c..8bed85f9b3e 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java
@@ -13,10 +13,6 @@
package org.eclipse.jetty.security.authentication;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@@ -24,10 +20,10 @@ import javax.servlet.http.HttpSession;
import org.eclipse.jetty.security.Authenticator;
import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.security.LoginService;
+import org.eclipse.jetty.server.session.AbstractSessionManager;
public abstract class LoginAuthenticator implements Authenticator
{
- public final static String SESSION_SECURED="org.eclipse.jetty.security.secured";
protected final DeferredAuthentication _deferred=new DeferredAuthentication(this);
protected LoginService _loginService;
protected IdentityService _identityService;
@@ -53,34 +49,29 @@ public abstract class LoginAuthenticator implements Authenticator
return _loginService;
}
- /* ------------------------------------------------------------ */
- /** Change the session when the request is authenticated for the first time
+ /** Change the session id.
+ * The session is changed to a new instance with a new ID if and only if:
+ * - A session exists.
+ *
- The {@link AuthConfiguration#isSessionRenewedOnAuthentication()} returns true.
+ *
- The session ID has been given to unauthenticated responses
+ *
* @param request
* @param response
* @return The new session.
*/
- protected HttpSession renewSessionOnAuthentication(HttpServletRequest request, HttpServletResponse response)
+ protected HttpSession renewSession(HttpServletRequest request, HttpServletResponse response)
{
HttpSession httpSession = request.getSession(false);
- if (_renewSession && httpSession!=null && httpSession.getAttribute(SESSION_SECURED)==null)
+
+ //if we should renew sessions, and there is an existing session that may have been seen by non-authenticated users
+ //(indicated by SESSION_SECURED not being set on the session) then we should change id
+ if (_renewSession && httpSession!=null && httpSession.getAttribute(AbstractSessionManager.SESSION_KNOWN_ONLY_TO_AUTHENTICATED)!=Boolean.TRUE)
{
synchronized (this)
{
- Map attributes = new HashMap();
- for (Enumeration e=httpSession.getAttributeNames();e.hasMoreElements();)
- {
- String name=e.nextElement();
- attributes.put(name,httpSession.getAttribute(name));
- httpSession.removeAttribute(name);
- }
- httpSession.invalidate();
- httpSession = request.getSession(true);
- httpSession.setAttribute(SESSION_SECURED,Boolean.TRUE);
- for (Map.Entry entry: attributes.entrySet())
- httpSession.setAttribute(entry.getKey(),entry.getValue());
+ httpSession = AbstractSessionManager.renewSession(request, httpSession,true);
}
}
-
return httpSession;
}
}
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java
index e63e597ccae..368c1d6193e 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java
@@ -29,6 +29,7 @@ import org.eclipse.jetty.security.SecurityHandler;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.UserIdentity.Scope;
+import org.eclipse.jetty.server.session.AbstractSessionManager;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -102,7 +103,7 @@ public class SessionAuthentication implements Authentication.User, Serializable,
if (security!=null)
security.logout(this);
if (_session!=null)
- _session.removeAttribute(LoginAuthenticator.SESSION_SECURED);
+ _session.removeAttribute(AbstractSessionManager.SESSION_KNOWN_ONLY_TO_AUTHENTICATED);
}
@Override
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java
index a4d39804613..e432e489235 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java
@@ -37,6 +37,7 @@ import org.eclipse.jetty.util.ByteArrayISO8859Writer;
public class ErrorHandler extends AbstractHandler
{
boolean _showStacks=true;
+ boolean _showMessageInTitle=true;
String _cacheControl="must-revalidate,no-cache,no-store";
/* ------------------------------------------------------------ */
@@ -86,12 +87,16 @@ public class ErrorHandler extends AbstractHandler
/* ------------------------------------------------------------ */
protected void writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message)
throws IOException
- {
+ {
writer.write("\n");
writer.write("Error ");
writer.write(Integer.toString(code));
- writer.write(' ');
- write(writer,message);
+
+ if (_showMessageInTitle)
+ {
+ writer.write(' ');
+ write(writer,message);
+ }
writer.write("\n");
}
@@ -175,6 +180,22 @@ public class ErrorHandler extends AbstractHandler
{
_showStacks = showStacks;
}
+
+ /* ------------------------------------------------------------ */
+ /**
+ * @param showMessageInTitle if true, the error message appears in page title
+ */
+ public void setShowMessageInTitle(boolean showMessageInTitle)
+ {
+ _showMessageInTitle = showMessageInTitle;
+ }
+
+
+ /* ------------------------------------------------------------ */
+ public boolean getShowMessageInTitle()
+ {
+ return _showMessageInTitle;
+ }
/* ------------------------------------------------------------ */
protected void write(Writer writer,String string)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java
index e2b11e35337..ce527a7d90b 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.Enumeration;
import java.util.EventListener;
import java.util.HashSet;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -69,6 +70,8 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
new HashSet(
Arrays.asList(new SessionTrackingMode[]{SessionTrackingMode.COOKIE,SessionTrackingMode.URL})));
+ public final static String SESSION_KNOWN_ONLY_TO_AUTHENTICATED="org.eclipse.jetty.security.sessionKnownOnlytoAuthenticated";
+
/* ------------------------------------------------------------ */
public final static int __distantFuture=60*60*24*7*52*20;
@@ -121,6 +124,28 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
protected final CounterStatistic _sessionsStats = new CounterStatistic();
protected final SampleStatistic _sessionTimeStats = new SampleStatistic();
+
+ /* ------------------------------------------------------------ */
+ public static HttpSession renewSession (HttpServletRequest request, HttpSession httpSession, boolean authenticated)
+ {
+ Map attributes = new HashMap();
+
+ for (Enumeration e=httpSession.getAttributeNames();e.hasMoreElements();)
+ {
+ String name=e.nextElement();
+ attributes.put(name,httpSession.getAttribute(name));
+ httpSession.removeAttribute(name);
+ }
+
+ httpSession.invalidate();
+ httpSession = request.getSession(true);
+ if (authenticated)
+ httpSession.setAttribute(SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
+ for (Map.Entry entry: attributes.entrySet())
+ httpSession.setAttribute(entry.getKey(),entry.getValue());
+ return httpSession;
+ }
+
/* ------------------------------------------------------------ */
public AbstractSessionManager()
{
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
index ddd0c35bc67..d3ff7a2bda7 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
@@ -121,6 +121,19 @@ public class HttpConnectionTest
System.err.println(response);
}
}
+
+ @Test
+ public void testNoPath() throws Exception
+ {
+ String response=connector.getResponses("GET http://localhost:80 HTTP/1.1\n"+
+ "Host: localhost:80\n"+
+ "\n");
+
+ int offset=0;
+ offset = checkContains(response,offset,"HTTP/1.1 200");
+ checkContains(response,offset,"pathInfo=/");
+ }
+
@Test
public void testEmpty() throws Exception
@@ -183,9 +196,15 @@ public class HttpConnectionTest
response=connector.getResponses("GET % HTTP/1.1\n"+
"Host: localhost\n"+
- "Connection: close\n"+
+ "Connection: close\n"+
"\015\012");
- checkContains(response,0,"HTTP/1.1 400");
+ checkContains(response,0,"HTTP/1.1 200"); //now fallback to iso-8859-1
+
+ response=connector.getResponses("GET /bad/utf8%c1 HTTP/1.1\n"+
+ "Host: localhost\n"+
+ "Connection: close\n"+
+ "\015\012");
+ checkContains(response,0,"HTTP/1.1 200"); //now fallback to iso-8859-1
}
@Test
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java
index b756d9f77c0..4630b17269b 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java
@@ -182,10 +182,11 @@ public class HttpURITest
private final String[][] encoding_tests=
{
- /* 0*/ {"/path/info","/path/info"},
- /* 1*/ {"/path/%69nfo","/path/info"},
- /* 2*/ {"http://host/path/%69nfo","/path/info"},
- /* 3*/ {"http://host/path/%69nf%c2%a4","/path/inf\u00a4"},
+ /* 0*/ {"/path/info","/path/info", "UTF-8"},
+ /* 1*/ {"/path/%69nfo","/path/info", "UTF-8"},
+ /* 2*/ {"http://host/path/%69nfo","/path/info", "UTF-8"},
+ /* 3*/ {"http://host/path/%69nf%c2%a4","/path/inf\u00a4", "UTF-8"},
+ /* 4*/ {"http://host/path/%E5", "/path/\u00e5", "ISO-8859-1"}
};
@Test
@@ -196,7 +197,7 @@ public class HttpURITest
for (int t=0;t list = new ArrayList<>(32);
+ List list = null;
+ try
+ {
+ list = listEntries();
+ }
+ catch (Exception e)
+ {
+ //Sun's JarURLConnection impl for jar: protocol will close a JarFile in its connect() method if
+ //useCaches == false (eg someone called URLConnection with defaultUseCaches==true).
+ //As their sun.net.www.protocol.jar package caches JarFiles and/or connections, we can wind up in
+ //the situation where the JarFile we have remembered in our _jarFile member has actually been closed
+ //by other code.
+ //So, do one retry to drop a connection and get a fresh JarFile
+ LOG.warn("Retrying list:"+e);
+ LOG.debug(e);
+ release();
+ list = listEntries();
+ }
- checkConnection();
-
- JarFile jarFile=_jarFile;
- if(jarFile==null)
+ if (list != null)
{
- try
- {
- JarURLConnection jc=(JarURLConnection)((new URL(_jarUrl)).openConnection());
- jc.setUseCaches(getUseCaches());
- jarFile=jc.getJarFile();
- }
- catch(Exception e)
- {
- LOG.ignore(e);
- }
- if(jarFile==null)
- throw new IllegalStateException();
- }
-
- Enumeration e=jarFile.entries();
- String dir=_urlString.substring(_urlString.indexOf("!/")+2);
- while(e.hasMoreElements())
- {
- JarEntry entry = e.nextElement();
- String name=entry.getName().replace('\\','/');
- if(!name.startsWith(dir) || name.length()==dir.length())
- {
- continue;
- }
- String listName=name.substring(dir.length());
- int dash=listName.indexOf('/');
- if (dash>=0)
- {
- //when listing jar:file urls, you get back one
- //entry for the dir itself, which we ignore
- if (dash==0 && listName.length()==1)
- continue;
- //when listing jar:file urls, all files and
- //subdirs have a leading /, which we remove
- if (dash==0)
- listName=listName.substring(dash+1, listName.length());
- else
- listName=listName.substring(0,dash+1);
-
- if (list.contains(listName))
- continue;
- }
-
- list.add(listName);
- }
-
- _list=new String[list.size()];
- list.toArray(_list);
+ _list=new String[list.size()];
+ list.toArray(_list);
+ }
}
return _list;
}
+
+ /* ------------------------------------------------------------ */
+ private List listEntries ()
+ {
+ checkConnection();
+
+ ArrayList list = new ArrayList(32);
+ JarFile jarFile=_jarFile;
+ if(jarFile==null)
+ {
+ try
+ {
+ JarURLConnection jc=(JarURLConnection)((new URL(_jarUrl)).openConnection());
+ jc.setUseCaches(getUseCaches());
+ jarFile=jc.getJarFile();
+ }
+ catch(Exception e)
+ {
+
+ e.printStackTrace();
+ LOG.ignore(e);
+ }
+ if(jarFile==null)
+ throw new IllegalStateException();
+ }
+
+ Enumeration e=jarFile.entries();
+ String dir=_urlString.substring(_urlString.indexOf("!/")+2);
+ while(e.hasMoreElements())
+ {
+
+ JarEntry entry = (JarEntry) e.nextElement();
+ String name=entry.getName().replace('\\','/');
+ if(!name.startsWith(dir) || name.length()==dir.length())
+ {
+ continue;
+ }
+ String listName=name.substring(dir.length());
+ int dash=listName.indexOf('/');
+ if (dash>=0)
+ {
+ //when listing jar:file urls, you get back one
+ //entry for the dir itself, which we ignore
+ if (dash==0 && listName.length()==1)
+ continue;
+ //when listing jar:file urls, all files and
+ //subdirs have a leading /, which we remove
+ if (dash==0)
+ listName=listName.substring(dash+1, listName.length());
+ else
+ listName=listName.substring(0,dash+1);
+
+ if (list.contains(listName))
+ continue;
+ }
+
+ list.add(listName);
+ }
+
+ return list;
+ }
+
+
+
+
+
/* ------------------------------------------------------------ */
/**
* Return the length of the resource
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java
index 42f4c191d36..f6536781812 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java
@@ -77,18 +77,28 @@ public class StdErrLogTest
log.debug("YOU SHOULD NOT SEE THIS!",null,null);
// Test for backward compat with old (now deprecated) method
+ Logger before = log.getLogger("before");
log.setDebugEnabled(true);
+ Logger after = log.getLogger("after");
+ before.debug("testing {} {}","test","debug-before");
log.debug("testing {} {}","test","debug-deprecated");
+ after.debug("testing {} {}","test","debug-after");
log.setDebugEnabled(false);
+ before.debug("testing {} {}","test","debug-before-false");
log.debug("testing {} {}","test","debug-deprecated-false");
-
+ after.debug("testing {} {}","test","debug-after-false");
+
output.assertContains("DBUG:xxx:tname: testing test debug");
output.assertContains("INFO:xxx:tname: testing test info");
output.assertContains("WARN:xxx:tname: testing test warn");
output.assertNotContains("YOU SHOULD NOT SEE THIS!");
- output.assertContains("DBUG:xxx:tname: testing test debug-deprecated");
+ output.assertContains("DBUG:x.before:tname:testing test debug-before");
output.assertNotContains("DBUG:xxx:tname: testing test debug-depdeprecated-false");
+ output.assertContains("DBUG:x.after:testing test debug-after");
+ output.assertNotContains("DBUG:x.before:tname:testing test debug-before-false");
+ output.assertNotContains("DBUG:xxx:tname:testing test debug-deprecated-false");
+ output.assertNotContains("DBUG:x.after:tname:testing test debug-after-false");
}
@Test
diff --git a/pom.xml b/pom.xml
index 6d832614bff..a2d8ded5b63 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,7 +51,7 @@
- org.eclipse.jetty.toolchain:jetty-artifact-remote-resources:1.0
+ org.eclipse.jetty.toolchain:jetty-artifact-remote-resources:1.1
@@ -623,5 +623,47 @@
+
+ license-check
+
+
+
+ false
+ com.mycila.maven-license-plugin
+ maven-license-plugin
+ 1.10.b1
+
+
+ true
+ true
+ true
+
+ ${project.inceptionYear}-2012
+
+
+ DOUBLESLASH_STYLE
+
+
+ **/*.java
+
+
+ jetty-util/src/main/java/org/eclipse/jetty/util/security/UnixCrypt.java
+ jetty-policy/src/main/java/org/eclipse/jetty/policy/loader/DefaultPolicyLoader.java
+ jetty-policy/src/main/java/org/eclipse/jetty/policy/loader/PolicyFileScanner.java
+
+
+
+
+ check-headers
+ verify
+
+ check
+
+
+
+
+
+
+