Merge branch 'master' into release-9

This commit is contained in:
Jesse McConnell 2013-09-30 12:28:04 -05:00
commit af2e6ff911
20 changed files with 78 additions and 66 deletions

View File

@ -328,7 +328,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
/**
* Check to see if the ServletContainerIntializer loaded via the ServiceLoader came
* from a jar that is excluded by the fragment ordering. See ServletSpec 3.0 p.85.
* @param orderedJars
* @param context
* @param service
* @return
*/

View File

@ -61,7 +61,7 @@ public class WebFilterAnnotation extends DiscoveredAnnotation
}
/**
* @see org.eclipse.jetty.annotations.ClassAnnotation#apply()
* @see DiscoveredAnnotation#apply()
*/
public void apply()
{

View File

@ -57,7 +57,7 @@ public class WebListenerAnnotation extends DiscoveredAnnotation
}
/**
* @see org.eclipse.jetty.annotations.ClassAnnotation#apply()
* @see DiscoveredAnnotation#apply()
*/
public void apply()
{

View File

@ -57,7 +57,7 @@ public class WebServletAnnotation extends DiscoveredAnnotation
}
/**
* @see org.eclipse.jetty.annotations.ClassAnnotation#apply()
* @see DiscoveredAnnotation#apply()
*/
public void apply()
{

View File

@ -1,9 +0,0 @@
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.LEVEL=INFO
org.eclipse.jetty.STACKS=true
org.eclipse.jetty.SOURCE=false
#org.eclipse.jetty.STACKS=false
#org.eclipse.jetty.spdy.LEVEL=DEBUG
#org.eclipse.jetty.server.LEVEL=DEBUG
#org.eclipse.jetty.io.ssl.LEVEL=DEBUG
#org.eclipse.jetty.spdy.server.LEVEL=DEBUG

View File

@ -57,7 +57,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getRequestHeaders()
* @see JettyHttpExchangeDelegate#getRequestHeaders()
*/
@Override
public Headers getRequestHeaders()
@ -67,7 +67,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getResponseHeaders()
* @see JettyHttpExchangeDelegate#getResponseHeaders()
*/
@Override
public Headers getResponseHeaders()
@ -77,7 +77,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getRequestURI()
* @see JettyHttpExchangeDelegate#getRequestURI()
*/
@Override
public URI getRequestURI()
@ -87,7 +87,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getRequestMethod()
* @see JettyHttpExchangeDelegate#getRequestMethod()
*/
@Override
public String getRequestMethod()
@ -97,7 +97,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getHttpContext()
* @see JettyHttpExchangeDelegate#getHttpContext()
*/
@Override
public HttpContext getHttpContext()
@ -107,7 +107,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#close()
* @see JettyHttpExchangeDelegate#close()
*/
@Override
public void close()
@ -127,7 +127,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getRequestBody()
* @see JettyHttpExchangeDelegate#getRequestBody()
*/
@Override
public InputStream getRequestBody()
@ -137,7 +137,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getResponseBody()
* @see JettyHttpExchangeDelegate#getResponseBody()
*/
@Override
public OutputStream getResponseBody()
@ -147,7 +147,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#sendResponseHeaders(int, long)
* @see JettyHttpExchangeDelegate#sendResponseHeaders(int, long)
*/
@Override
public void sendResponseHeaders(int rCode, long responseLength) throws IOException
@ -157,7 +157,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getRemoteAddress()
* @see JettyHttpExchangeDelegate#getRemoteAddress()
*/
@Override
public InetSocketAddress getRemoteAddress()
@ -167,7 +167,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getResponseCode()
* @see JettyHttpExchangeDelegate#getResponseCode()
*/
@Override
public int getResponseCode()
@ -177,7 +177,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getLocalAddress()
* @see JettyHttpExchangeDelegate#getLocalAddress()
*/
@Override
public InetSocketAddress getLocalAddress()
@ -187,7 +187,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getProtocol()
* @see JettyHttpExchangeDelegate#getProtocol()
*/
@Override
public String getProtocol()
@ -197,7 +197,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getAttribute(java.lang.String)
* @see JettyHttpExchangeDelegate#getAttribute(java.lang.String)
*/
@Override
public Object getAttribute(String name)
@ -207,7 +207,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#setAttribute(java.lang.String, java.lang.Object)
* @see JettyHttpExchangeDelegate#setAttribute(java.lang.String, java.lang.Object)
*/
@Override
public void setAttribute(String name, Object value)
@ -217,7 +217,7 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#setStreams(java.io.InputStream, java.io.OutputStream)
* @see JettyHttpExchangeDelegate#setStreams(java.io.InputStream, java.io.OutputStream)
*/
@Override
public void setStreams(InputStream i, OutputStream o)

View File

@ -272,6 +272,12 @@ public class HttpFieldsTest
public void testSetCookie() throws Exception
{
HttpFields fields = new HttpFields();
fields.addSetCookie("null",null,null,null,-1,null,false,false,-1);
assertEquals("null=",fields.getStringField("Set-Cookie"));
fields.clear();
fields.addSetCookie("minimal","value",null,null,-1,null,false,false,-1);
assertEquals("minimal=value",fields.getStringField("Set-Cookie"));

View File

@ -31,7 +31,6 @@ import org.eclipse.jetty.http.HttpParser.State;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.StringUtil;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@ -42,8 +41,8 @@ public class HttpParserTest
{
/* ------------------------------------------------------------------------------- */
/**
* Parse until {@link #END END} state.
* If the parser is already in the END state, then it is {@link #reset reset} and re-parsed.
* Parse until {@link State#END} state.
* If the parser is already in the END state, then it is {@link HttpParser#reset()} and re-parsed.
* @param parser The parser to test
* @throws IllegalStateException If the buffers have already been partially parsed.
*/

View File

@ -231,7 +231,10 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
}
catch (Exception x)
{
LOG.info("Exception while notifying connection " + connection, x);
if (isRunning())
LOG.warn("Exception while notifying connection " + connection, x);
else
LOG.debug("Exception while notifying connection {}",connection, x);
}
}

View File

@ -709,19 +709,20 @@ public class JettyRunForkedMojo extends AbstractMojo
if (PluginLog.getLog().isDebugEnabled())
PluginLog.getLog().debug(Arrays.toString(cmd.toArray()));
forkedProcess = builder.start();
PluginLog.getLog().info("Forked process starting");
if (waitForChild)
{
forkedProcess = builder.start();
startPump("STDOUT",forkedProcess.getInputStream());
startPump("STDERR",forkedProcess.getErrorStream());
int exitcode = forkedProcess.waitFor();
PluginLog.getLog().info("Forked execution exit: "+exitcode);
}
else
{ //we're not going to be reading the stderr as we're not waiting for the child to finish
forkedProcess.getErrorStream().close();
{ //merge stderr and stdout from child
builder.redirectErrorStream(true);
forkedProcess = builder.start();
//wait for the child to be ready before terminating.
//child indicates it has finished starting by printing on stdout the token passed to it
@ -754,6 +755,7 @@ public class JettyRunForkedMojo extends AbstractMojo
{
throw new MojoExecutionException ("Problem determining if forked process is ready: "+e.getMessage());
}
}
}
catch (InterruptedException ex)

View File

@ -174,7 +174,7 @@ public class JettyRunMojo extends AbstractJettyMojo
/**
* Verify the configuration given in the pom.
*
* @see org.mortbay.jetty.plugin.AbstractJettyMojo#checkPomConfiguration()
* @see AbstractJettyMojo#checkPomConfiguration()
*/
public void checkPomConfiguration () throws MojoExecutionException
{

View File

@ -78,7 +78,7 @@ public class JettyRunWarExplodedMojo extends AbstractJettyMojo
/**
*
* @see org.mortbay.jetty.plugin.AbstractJettyMojo#checkPomConfiguration()
* @see AbstractJettyMojo#checkPomConfiguration()
*/
public void checkPomConfiguration() throws MojoExecutionException
{
@ -89,7 +89,7 @@ public class JettyRunWarExplodedMojo extends AbstractJettyMojo
/**
* @see org.mortbay.jetty.plugin.AbstractJettyMojo#configureScanner()
* @see AbstractJettyMojo#configureScanner()
*/
public void configureScanner() throws MojoExecutionException
{

View File

@ -83,7 +83,7 @@ public class JettyRunWarMojo extends AbstractJettyMojo
/**
* @see org.mortbay.jetty.plugin.AbstractJettyMojo#checkPomConfiguration()
* @see AbstractJettyMojo#checkPomConfiguration()
*/
public void checkPomConfiguration() throws MojoExecutionException
{
@ -94,7 +94,7 @@ public class JettyRunWarMojo extends AbstractJettyMojo
/**
* @see org.eclipse.jetty.server.plugin.AbstractJettyMojo#configureScanner()
* @see AbstractJettyMojo#configureScanner()
*/
public void configureScanner() throws MojoExecutionException
{

View File

@ -21,6 +21,7 @@ package org.eclipse.jetty.server;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@ -321,13 +322,13 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
// Complete generating the response
_response.closeOutput();
}
catch(EofException e)
catch(EofException|ClosedChannelException e)
{
LOG.debug(e);
}
catch(Exception e)
{
LOG.warn(e);
LOG.warn("complete failed",e);
}
finally
{
@ -599,7 +600,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
}
catch (IOException e)
{
LOG.warn(e);
LOG.warn("badMessage",e);
}
finally
{
@ -719,7 +720,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
@Override
public void failed(final Throwable x)
{
if (x instanceof EofException)
if (x instanceof EofException || x instanceof ClosedChannelException)
{
LOG.debug(x);
_callback.failed(x);
@ -727,7 +728,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
}
else
{
LOG.warn(x);
LOG.warn("commit failed",x);
_transport.send(HttpGenerator.RESPONSE_500_INFO,null,true,new Callback()
{
@Override

View File

@ -286,7 +286,7 @@ public abstract class HttpInput<T> extends ServletInputStream
}
catch (IOException e)
{
LOG.warn(e);
LOG.debug(e);
break loop;
}
}

View File

@ -312,6 +312,7 @@ public class LowResourceMonitor extends AbstractLifeCycle
LOG.info("Low Resources cleared");
_reasons=null;
_lowStarted=0;
_cause=null;
clearLowResources();
}
}

View File

@ -41,10 +41,7 @@ import org.junit.Test;
/**
* This tests verifies that merging of queryStrings works when dispatching
* Requests via {@link Continuation} multiple times.
*
* @author tbecker
*
* Requests via {@link AsyncContext} multiple times.
*/
public class AsyncContextDispatchWithQueryStrings {

View File

@ -56,7 +56,7 @@ public class SSLExternalServerTest extends AbstractHTTPSPDYTest
return new SPDYClient.Factory(threadPool, null, sslContextFactory, 30000);
}
@Test
@Test(timeout=5000)
public void testExternalServer() throws Exception
{
String host = "encrypted.google.com";

View File

@ -32,6 +32,8 @@ import java.nio.channels.ReadableByteChannel;
import java.nio.file.StandardOpenOption;
import java.security.Permission;
import javax.management.RuntimeErrorException;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;
@ -148,9 +150,19 @@ public class FileResource extends Resource
}
catch(IOException e)
{
LOG.warn(e);
LOG.warn("bad alias for {}: {}",file,e.toString());
LOG.debug(e);
try
{
return new URL("http://eclipse.org/bad/canonical/alias");
}
catch(Exception e2)
{
LOG.ignore(e2);
throw new RuntimeException(e);
}
}
return null;
}

View File

@ -102,7 +102,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#putValues(Object, List)}
* Tests {@link MultiMap#putValues(String, List)}
*/
@Test
public void testPutValues_List()
@ -122,7 +122,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#putValues(Object, String...)}
* Tests {@link MultiMap#putValues(String, Object...)}
*/
@Test
public void testPutValues_StringArray()
@ -138,7 +138,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#putValues(Object, String...)}
* Tests {@link MultiMap#putValues(String, Object...)}
*/
@Test
public void testPutValues_VarArgs()
@ -153,7 +153,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#add(Object, Object)}
* Tests {@link MultiMap#add(String, Object)}
*/
@Test
public void testAdd()
@ -176,7 +176,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#addValues(Object, List)}
* Tests {@link MultiMap#addValues(String, List)}
*/
@Test
public void testAddValues_List()
@ -202,7 +202,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#addValues(Object, List)}
* Tests {@link MultiMap#addValues(String, List)}
*/
@Test
public void testAddValues_List_Empty()
@ -225,7 +225,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#addValues(Object, String[])}
* Tests {@link MultiMap#addValues(String, Object[])}
*/
@Test
public void testAddValues_StringArray()
@ -248,7 +248,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#addValues(Object, String[])}
* Tests {@link MultiMap#addValues(String, Object[])}
*/
@Test
public void testAddValues_StringArray_Empty()
@ -271,7 +271,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#removeValue(Object, Object)}
* Tests {@link MultiMap#removeValue(String, Object)}
*/
@Test
public void testRemoveValue()
@ -293,7 +293,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#removeValue(Object, Object)}
* Tests {@link MultiMap#removeValue(String, Object)}
*/
@Test
public void testRemoveValue_InvalidItem()
@ -314,7 +314,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#removeValue(Object, Object)}
* Tests {@link MultiMap#removeValue(String, Object)}
*/
@Test
public void testRemoveValue_AllItems()
@ -344,7 +344,7 @@ public class MultiMapTest
}
/**
* Tests {@link MultiMap#removeValue(Object, Object)}
* Tests {@link MultiMap#removeValue(String, Object)}
*/
@Test
public void testRemoveValue_FromEmpty()