Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x

This commit is contained in:
Joakim Erdfelt 2021-02-15 14:18:08 -06:00
commit d6ec96fe1b
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
75 changed files with 277 additions and 271 deletions

View File

@ -98,7 +98,7 @@
<!-- Member Name Format -->
<module name="MemberName">
<property name="format" value="^[_a-z][a-zA-Z0-9]*$"/>
<property name="format" value="^[_a-z][a-zA-Z0-9]*$" />
</module>
<!-- require braces is disabled - we don't enforce that in Jetty
@ -107,10 +107,15 @@
</module>
-->
<!-- Enforced Whitespace After specific tokens -->
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI, LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE" />
</module>
<!-- No Whitespace After specific tokens -->
<module name="NoWhitespaceAfter">
<property name="tokens" value="ARRAY_INIT, AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, ARRAY_DECLARATOR, INDEX_OP, TYPECAST"/>
<property name="allowLineBreaks" value="true"/>
<property name="tokens" value="ARRAY_INIT, AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, ARRAY_DECLARATOR, INDEX_OP, TYPECAST" />
<property name="allowLineBreaks" value="true" />
</module>
<!-- No Whitespace Before specific tokens -->

View File

@ -113,7 +113,7 @@ public class DispatchServletTest
context.addServlet(DefaultServlet.class, "/");
String[] selfRefs =
{"/dispatch/forward", "/dispatch/includeS", "/dispatch/includeW", "/dispatch/includeN",};
{"/dispatch/forward", "/dispatch/includeS", "/dispatch/includeW", "/dispatch/includeN"};
/*
* Number of nested dispatch requests. 220 is a good value, as it won't

View File

@ -250,7 +250,7 @@ public class SessionDocs
//Make a factory for memcached L2 caches for SessionData
MemcachedSessionDataMapFactory mapFactory = new MemcachedSessionDataMapFactory();
mapFactory.setExpirySec(0); //items in memcached don't expire
mapFactory.setHeartbeats(true);//tell memcached to use heartbeats
mapFactory.setHeartbeats(true); //tell memcached to use heartbeats
mapFactory.setAddresses(new InetSocketAddress("localhost", 11211)); //use a local memcached instance
mapFactory.setWeights(new int[] {100}); //set the weighting

View File

@ -30,7 +30,7 @@ public class ResourceA implements javax.servlet.Servlet
private Integer k;
@Resource(name = "myf", mappedName = "resB") //test giving both a name and mapped name from the environment
private Integer f;//test a non inherited field that needs injection
private Integer f; //test a non inherited field that needs injection
@Resource(mappedName = "resA") //test the default naming scheme but using a mapped name from the environment
private Integer g;

View File

@ -26,7 +26,7 @@ import javax.annotation.Resources;
public class ResourceB extends ResourceA
{
@Resource(mappedName = "resB")
private Integer f;//test no inheritance of private fields
private Integer f; //test no inheritance of private fields
@Resource
private Integer p = 8; //test no injection because no value

View File

@ -32,17 +32,17 @@ public class HttpGeneratorClientTest
{
RequestInfo(String method, String uri, HttpFields fields)
{
super(method, HttpURI.from(method,uri), HttpVersion.HTTP_1_1, fields, -1);
super(method, HttpURI.from(method, uri), HttpVersion.HTTP_1_1, fields, -1);
}
RequestInfo(String method, String uri, HttpVersion version, HttpFields fields)
{
super(method, HttpURI.from(method,uri), version, fields, -1);
super(method, HttpURI.from(method, uri), version, fields, -1);
}
RequestInfo(String method, String uri, int contentLength, HttpFields fields)
{
super(method, HttpURI.from(method,uri), HttpVersion.HTTP_1_1, fields, contentLength);
super(method, HttpURI.from(method, uri), HttpVersion.HTTP_1_1, fields, contentLength);
}
}

View File

@ -82,13 +82,13 @@ public class HttpParserTest
{
for (HttpMethod m : HttpMethod.values())
{
assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer(m.asString().substring(0,2))));
assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer(m.asString().substring(0, 2))));
assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer(m.asString())));
assertNull(HttpMethod.lookAheadGet(BufferUtil.toBuffer(m.asString() + "FOO")));
assertEquals(m, HttpMethod.lookAheadGet(BufferUtil.toBuffer(m.asString() + " ")));
assertEquals(m, HttpMethod.lookAheadGet(BufferUtil.toBuffer(m.asString() + " /foo/bar")));
assertNull(HttpMethod.lookAheadGet(m.asString().substring(0,2).getBytes(), 0,2));
assertNull(HttpMethod.lookAheadGet(m.asString().substring(0, 2).getBytes(), 0, 2));
assertNull(HttpMethod.lookAheadGet(m.asString().getBytes(), 0, m.asString().length()));
assertNull(HttpMethod.lookAheadGet((m.asString() + "FOO").getBytes(), 0, m.asString().length() + 3));
assertEquals(m, HttpMethod.lookAheadGet(("\n" + m.asString() + " ").getBytes(), 1, m.asString().length() + 2));

View File

@ -203,7 +203,7 @@ public class HpackEncoder
encode(buffer, HttpScheme.HTTPS.is(scheme) ? C_SCHEME_HTTPS : C_SCHEME_HTTP);
encode(buffer, new HttpField(HttpHeader.C_PATH, request.getURI().getPathQuery()));
if (protocol != null)
encode(buffer,new HttpField(HttpHeader.C_PROTOCOL,protocol));
encode(buffer, new HttpField(HttpHeader.C_PROTOCOL, protocol));
}
}
else if (metadata.isResponse())

View File

@ -103,15 +103,15 @@ public class SessionDataMarshaller
@Override
public InfinispanSessionData readFrom(ProtoStreamReader in) throws IOException
{
final int version = in.readInt("version");// version of serialized session
final int version = in.readInt("version"); // version of serialized session
final String id = in.readString("id"); // session id
final String cpath = in.readString("contextPath"); // context path
final String vhost = in.readString("vhost"); // first vhost
final long accessed = in.readLong("accessed");// accessTime
final long accessed = in.readLong("accessed"); // accessTime
final long lastAccessed = in.readLong("lastAccessed"); // lastAccessTime
final long created = in.readLong("created"); // time created
final long cookieSet = in.readLong("cookieSet");// time cookie was set
final long cookieSet = in.readLong("cookieSet"); // time cookie was set
final String lastNode = in.readString("lastNode"); // name of last node
// managing
@ -142,10 +142,10 @@ public class SessionDataMarshaller
out.writeString("contextPath", sdata.getContextPath()); // context path
out.writeString("vhost", sdata.getVhost()); // first vhost
out.writeLong("accessed", sdata.getAccessed());// accessTime
out.writeLong("accessed", sdata.getAccessed()); // accessTime
out.writeLong("lastAccessed", sdata.getLastAccessed()); // lastAccessTime
out.writeLong("created", sdata.getCreated()); // time created
out.writeLong("cookieSet", sdata.getCookieSet());// time cookie was set
out.writeLong("cookieSet", sdata.getCookieSet()); // time cookie was set
out.writeString("lastNode", sdata.getLastNode()); // name of last node
// managing

View File

@ -70,14 +70,14 @@ public class RemoteQueryManagerTest
GenericContainer infinispan =
new GenericContainer(System.getProperty("infinispan.docker.image.name", "jboss/infinispan-server") +
":" + System.getProperty("infinispan.docker.image.version", "9.4.8.Final"))
.withEnv("APP_USER","theuser")
.withEnv("APP_PASS","foobar")
":" + System.getProperty("infinispan.docker.image.version", "9.4.8.Final"))
.withEnv("APP_USER", "theuser")
.withEnv("APP_PASS", "foobar")
.withEnv("MGMT_USER", "admin")
.withEnv("MGMT_PASS", "admin")
.waitingFor(new LogMessageWaitStrategy()
.withRegEx(".*Infinispan Server.*started in.*\\s"))
.withExposedPorts(4712,4713,8088,8089,8443,9990,9993,11211,11222,11223,11224)
.withRegEx(".*Infinispan Server.*started in.*\\s"))
.withExposedPorts(4712, 4713, 8088, 8089, 8443, 9990, 9993, 11211, 11222, 11223, 11224)
.withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
@BeforeEach

View File

@ -77,7 +77,7 @@ public class PropertyUserStoreManager extends AbstractLifeCycle
@Override
protected void doStop() throws Exception
{
for (Map.Entry<String,PropertyUserStore> entry: _propertyUserStores.entrySet())
for (Map.Entry<String, PropertyUserStore> entry : _propertyUserStores.entrySet())
{
try
{

View File

@ -30,7 +30,7 @@ public abstract class AbstractForker extends AbstractLifeCycle
{
private static final Logger LOG = LoggerFactory.getLogger(AbstractForker.class);
protected Map<String,String> env;
protected Map<String, String> env;
protected String jvmArgs;
@ -40,7 +40,7 @@ public abstract class AbstractForker extends AbstractLifeCycle
protected List<File> jettyXmlFiles;
protected Map<String,String> jettyProperties;
protected Map<String, String> jettyProperties;
protected int stopPort;
@ -58,7 +58,7 @@ public abstract class AbstractForker extends AbstractLifeCycle
protected File workDir;
protected Map<String,String> systemProperties;
protected Map<String, String> systemProperties;
protected abstract ProcessBuilder createCommand();

View File

@ -195,7 +195,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
* Optional jetty properties to put on the command line
*/
@Parameter
protected Map<String,String> jettyProperties;
protected Map<String, String> jettyProperties;
/**
@ -219,7 +219,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
* Optional.
*/
@Parameter
protected Map<String,String> systemProperties;
protected Map<String, String> systemProperties;
/**
* Controls how to run jetty. Valid values are EMBED,FORK,HOME.
@ -272,7 +272,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
* Extra environment variables to be passed to the forked process
*/
@Parameter
protected Map<String,String> env = new HashMap<String,String>();
protected Map<String, String> env = new HashMap<>();
/**
* Arbitrary jvm args to pass to the forked process
@ -381,7 +381,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
/**
* System properties from both systemPropertyFile and systemProperties.
*/
protected Map<String,String> mergedSystemProperties;
protected Map<String, String> mergedSystemProperties;
@Override
public void execute() throws MojoExecutionException, MojoFailureException
@ -566,10 +566,10 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
* @return united properties map
* @throws MojoExecutionException
*/
protected Map<String,String> mergeSystemProperties()
protected Map<String, String> mergeSystemProperties()
throws MojoExecutionException
{
Map<String,String> properties = new HashMap<>();
Map<String, String> properties = new HashMap<>();
//Get the properties from any file first
if (systemPropertiesFile != null)
@ -583,7 +583,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
}
catch (Exception e)
{
throw new MojoExecutionException("Problem applying system properties from file " + systemPropertiesFile.getName(),e);
throw new MojoExecutionException("Problem applying system properties from file " + systemPropertiesFile.getName(), e);
}
}
//Allow systemProperties defined in the pom to override the file
@ -599,7 +599,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
{
if (mergedSystemProperties != null)
{
for (Map.Entry<String,String> e : mergedSystemProperties.entrySet())
for (Map.Entry<String, String> e : mergedSystemProperties.entrySet())
{
if (!StringUtil.isEmpty(e.getKey()) && !StringUtil.isEmpty(e.getValue()))
{
@ -785,7 +785,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
if (webApp.getTempDirectory() == null)
{
File target = new File(project.getBuild().getDirectory());
File tmp = new File(target,"tmp");
File tmp = new File(target, "tmp");
if (!tmp.exists())
{
if (!tmp.mkdirs())

View File

@ -45,7 +45,7 @@ public class JettyEmbedder extends AbstractLifeCycle
protected boolean exitVm;
protected boolean stopAtShutdown;
protected List<File> jettyXmlFiles;
protected Map<String,String> jettyProperties;
protected Map<String, String> jettyProperties;
protected ShutdownMonitor shutdownMonitor;
protected int stopPort;
protected String stopKey;

View File

@ -67,7 +67,7 @@ public class JettyForkedChild extends AbstractLifeCycle
public void configure(String[] args)
throws Exception
{
Map<String,String> jettyProperties = new HashMap<>();
Map<String, String> jettyProperties = new HashMap<>();
for (int i = 0; i < args.length; i++)
{

View File

@ -137,7 +137,7 @@ public class JettyForker extends AbstractForker
if (jvmArgs != null)
{
String[] args = jvmArgs.split(" ");
for (int i = 0;args != null && i < args.length;i++)
for (int i = 0; args != null && i < args.length; i++)
{
if (args[i] != null && !"".equals(args[i]))
cmd.add(args[i].trim());
@ -146,7 +146,7 @@ public class JettyForker extends AbstractForker
if (systemProperties != null)
{
for (Map.Entry<String,String> e:systemProperties.entrySet())
for (Map.Entry<String, String> e:systemProperties.entrySet())
{
cmd.add("-D" + e.getKey() + "=" + e.getValue());
}
@ -233,7 +233,7 @@ public class JettyForker extends AbstractForker
File javaHomeDir = new File(System.getProperty("java.home"));
for (String javaexe : javaexes)
{
File javabin = new File(javaHomeDir,fileSeparators("bin/" + javaexe));
File javabin = new File(javaHomeDir, fileSeparators("bin/" + javaexe));
if (javabin.exists() && javabin.isFile())
{
return javabin.getAbsolutePath();

View File

@ -397,7 +397,7 @@ public class JettyHomeForker extends AbstractForker
JarResource res = (JarResource)JarResource.newJarResource(Resource.newResource(jettyHomeZip));
res.copyTo(baseDir);
//zip will unpack to target/jetty-home-<VERSION>
jettyHome = new File(baseDir,"jetty-home-" + version);
jettyHome = new File(baseDir, "jetty-home-" + version);
}
}
}

View File

@ -195,7 +195,7 @@ public class JettyRunMojo extends AbstractUnassembledWebAppMojo
}
catch (Exception e)
{
getLog().error("Error reconfiguring/restarting webapp after change in watched files",e);
getLog().error("Error reconfiguring/restarting webapp after change in watched files", e);
}
}
});
@ -223,7 +223,7 @@ public class JettyRunMojo extends AbstractUnassembledWebAppMojo
scanner.addFile(new File(webApp.getOverrideDescriptor()).toPath());
}
File jettyWebXmlFile = findJettyWebXmlFile(new File(webAppSourceDirectory,"WEB-INF"));
File jettyWebXmlFile = findJettyWebXmlFile(new File(webAppSourceDirectory, "WEB-INF"));
if (jettyWebXmlFile != null)
{
scanner.addFile(jettyWebXmlFile.toPath());

View File

@ -201,7 +201,7 @@ public class JettyRunWarMojo extends AbstractWebAppMojo
}
catch (Exception e)
{
getLog().error("Error reconfiguring/restarting webapp after change in watched files",e);
getLog().error("Error reconfiguring/restarting webapp after change in watched files", e);
}
}
});

View File

@ -92,7 +92,7 @@ public class ServerSupport
* @param connector the connector
* @param properties jetty properties
*/
public static void configureConnectors(Server server, Connector connector, Map<String,String> properties)
public static void configureConnectors(Server server, Connector connector, Map<String, String> properties)
{
if (server == null)
throw new IllegalArgumentException("Server is null");
@ -190,7 +190,7 @@ public class ServerSupport
if (files == null || files.isEmpty())
return server;
Map<String,Object> lastMap = new HashMap<String,Object>();
Map<String, Object> lastMap = new HashMap<>();
if (server != null)
lastMap.put("Server", server);

View File

@ -184,7 +184,7 @@ public class WebAppPropertyConverter
*
* @throws Exception
*/
public static void fromProperties(MavenWebAppContext webApp, Properties webAppProperties, Server server, Map<String,String> jettyProperties)
public static void fromProperties(MavenWebAppContext webApp, Properties webAppProperties, Server server, Map<String, String> jettyProperties)
throws Exception
{
if (webApp == null)
@ -308,7 +308,7 @@ public class WebAppPropertyConverter
* @param jettyProperties jetty properties to use if there is a context xml file to apply
* @throws Exception
*/
public static void fromProperties(MavenWebAppContext webApp, File propsFile, Server server, Map<String,String> jettyProperties)
public static void fromProperties(MavenWebAppContext webApp, File propsFile, Server server, Map<String, String> jettyProperties)
throws Exception
{

View File

@ -83,7 +83,7 @@ public class TestJettyEmbedder
Path baseResource = workDir.getEmptyPathDir();
webApp.setBaseResource(Resource.newResource(baseResource));
Server server = new Server();
Map<String,String> jettyProperties = new HashMap<>();
Map<String, String> jettyProperties = new HashMap<>();
jettyProperties.put("jetty.server.dumpAfterStart", "false");
ContextHandler otherHandler = new ContextHandler();

View File

@ -110,7 +110,7 @@ public class TestWebAppPropertyConverter
assertEquals("false", props.get(WebAppPropertyConverter.TMP_DIR_PERSIST));
assertEquals(classesDir.getAbsolutePath(), props.get(WebAppPropertyConverter.CLASSES_DIR));
assertEquals(testClassesDir.getAbsolutePath(), props.get(WebAppPropertyConverter.TEST_CLASSES_DIR));
assertEquals(String.join(",", jar1.getAbsolutePath(),jar2.getAbsolutePath()), props.get(WebAppPropertyConverter.LIB_JARS));
assertEquals(String.join(",", jar1.getAbsolutePath(), jar2.getAbsolutePath()), props.get(WebAppPropertyConverter.LIB_JARS));
assertEquals(war.getAbsolutePath(), props.get(WebAppPropertyConverter.WAR_FILE));
assertEquals(WebAppContext.WEB_DEFAULTS_XML, props.get(WebAppPropertyConverter.DEFAULTS_DESCRIPTOR));
assertEquals(String.join(",", override1.getAbsolutePath(), override2.getAbsolutePath()), props.get(WebAppPropertyConverter.OVERRIDE_DESCRIPTORS));
@ -129,7 +129,7 @@ public class TestWebAppPropertyConverter
props.setProperty(WebAppPropertyConverter.CLASSES_DIR, classesDir.getAbsolutePath());
props.setProperty(WebAppPropertyConverter.CONTEXT_PATH, "/foo");
props.setProperty(WebAppPropertyConverter.CONTEXT_XML, contextXml);
props.setProperty(WebAppPropertyConverter.LIB_JARS, String.join(",", jar1.getAbsolutePath(),jar2.getAbsolutePath()));
props.setProperty(WebAppPropertyConverter.LIB_JARS, String.join(",", jar1.getAbsolutePath(), jar2.getAbsolutePath()));
props.setProperty(WebAppPropertyConverter.OVERRIDE_DESCRIPTORS, String.join(",", override1.getAbsolutePath(), override2.getAbsolutePath()));
//props.setProperty(WebAppPropertyConverter.QUICKSTART_WEB_XML, value);
props.setProperty(WebAppPropertyConverter.TEST_CLASSES_DIR, testClassesDir.getAbsolutePath());

View File

@ -97,7 +97,7 @@ public class OpenIdAuthenticationTest
OpenIdConfiguration configuration = new OpenIdConfiguration(openIdProvider.getProvider(), CLIENT_ID, CLIENT_SECRET);
// Configure OpenIdLoginService optionally providing a base LoginService to provide user roles
OpenIdLoginService loginService = new OpenIdLoginService(configuration);//, hashLoginService);
OpenIdLoginService loginService = new OpenIdLoginService(configuration);
securityHandler.setLoginService(loginService);
Authenticator authenticator = new OpenIdAuthenticator(configuration, "/error");

View File

@ -48,12 +48,12 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
private static Field FILE_FIELD = null;
private static Field BUNDLE_FILE_FIELD_FOR_DIR_ZIP_BUNDLE_ENTRY = null;// ZipBundleFile
private static Field BUNDLE_FILE_FIELD_FOR_DIR_ZIP_BUNDLE_ENTRY = null; // ZipBundleFile
// inside
// DirZipBundleEntry
private static Field ZIP_FILE_FILED_FOR_ZIP_BUNDLE_FILE = null;// ZipFile
private static Field ZIP_FILE_FILED_FOR_ZIP_BUNDLE_FILE = null; // ZipFile
private static final String[] FILE_BUNDLE_ENTRY_CLASSES = {
"org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry", "org.eclipse.osgi.storage.bundlefile.FileBundleEntry"

View File

@ -38,7 +38,7 @@ public class InjectionCollection
public static final String INJECTION_COLLECTION = "org.eclipse.jetty.injectionCollection";
private final ConcurrentMap<String, Set<Injection>> _injectionMap = new ConcurrentHashMap<>();//map of classname to injections
private final ConcurrentMap<String, Set<Injection>> _injectionMap = new ConcurrentHashMap<>(); //map of classname to injections
public void add(Injection injection)
{

View File

@ -30,7 +30,7 @@ public class RunAsCollection
private static final Logger LOG = LoggerFactory.getLogger(RunAsCollection.class);
public static final String RUNAS_COLLECTION = "org.eclipse.jetty.runAsCollection";
private ConcurrentMap<String, RunAs> _runAsMap = new ConcurrentHashMap<String, RunAs>();//map of classname to run-as
private ConcurrentMap<String, RunAs> _runAsMap = new ConcurrentHashMap<String, RunAs>(); //map of classname to run-as
public void add(RunAs runAs)
{

View File

@ -249,7 +249,7 @@ public class EnvConfiguration extends AbstractConfiguration
{
ee.bindToENC(ee.getJndiName());
Name namingEntryName = NamingEntryUtil.makeNamingEntryName(null, ee);
NamingUtil.bind(envCtx, namingEntryName.toString(), ee);//also save the EnvEntry in the context so we can check it later
NamingUtil.bind(envCtx, namingEntryName.toString(), ee); //also save the EnvEntry in the context so we can check it later
}
}

View File

@ -183,7 +183,7 @@ public class RuleContainer extends Rule implements Dumpable
else
{
HttpURI baseUri = baseRequest.getHttpURI();
baseRequest.setHttpURI(HttpURI.build(baseUri,encoded)
baseRequest.setHttpURI(HttpURI.build(baseUri, encoded)
.param(baseUri.getParam())
.query(baseUri.getQuery()));
}

View File

@ -30,7 +30,6 @@ import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.security.authentication.BasicAuthenticator;
import org.eclipse.jetty.server.AbstractConnector;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.CustomRequestLog;
import org.eclipse.jetty.server.Handler;
@ -277,7 +276,7 @@ public class Runner
_configFiles.add(args[++i]);
break;
case "--lib":
++i;//skip
++i; //skip
break;
case "--jar":
@ -285,7 +284,7 @@ public class Runner
break;
case "--classes":
++i;//skip
++i; //skip
break;
case "--stats":

View File

@ -155,7 +155,7 @@ public class ClientCertAuthenticatorTest
@Test
public void authzPass() throws Exception
{
HttpsURLConnection.setDefaultHostnameVerifier((s,sslSession) -> true);
HttpsURLConnection.setDefaultHostnameVerifier((s, sslSession) -> true);
SslContextFactory.Server cf = createServerSslContextFactory("cacerts.jks", "changeit");
cf.start();
HttpsURLConnection.setDefaultSSLSocketFactory(cf.getSslContext().getSocketFactory());

View File

@ -745,7 +745,7 @@ public class ConstraintTest
constraint8.setRoles(new String[]{"foo"});
ConstraintMapping mapping8 = new ConstraintMapping();
mapping8.setPathSpec("/omit/*");
mapping8.setConstraint(constraint8);//requests for all methods must be in role "foo"
mapping8.setConstraint(constraint8); //requests for all methods must be in role "foo"
list.add(mapping8);
Set<String> knownRoles = new HashSet<>();

View File

@ -404,7 +404,7 @@ public abstract class HttpChannel implements Runnable, HttpOutput.Interceptor
case ASYNC_DISPATCH:
{
dispatch(DispatcherType.ASYNC,() -> getServer().handleAsync(this));
dispatch(DispatcherType.ASYNC, () -> getServer().handleAsync(this));
break;
}
@ -443,7 +443,7 @@ public abstract class HttpChannel implements Runnable, HttpOutput.Interceptor
break;
}
dispatch(DispatcherType.ERROR,() ->
dispatch(DispatcherType.ERROR, () ->
{
errorHandler.handle(null, _request, _request, _response);
_request.setHandled(true);

View File

@ -488,7 +488,7 @@ public class HttpConfiguration implements Dumpable
*/
public void addFormEncodedMethod(String method)
{
_formEncodedMethods.put(method,Boolean.TRUE);
_formEncodedMethods.put(method, Boolean.TRUE);
}
/**

View File

@ -334,7 +334,7 @@ public class Request implements HttpServletRequest
id = getRequestedSessionId();
}
Map<String,String> cookies = new HashMap<>();
Map<String, String> cookies = new HashMap<>();
Cookie[] existingCookies = getCookies();
if (existingCookies != null)
{
@ -363,7 +363,7 @@ public class Request implements HttpServletRequest
if (!cookies.isEmpty())
{
StringBuilder buff = new StringBuilder();
for (Map.Entry<String,String> entry : cookies.entrySet())
for (Map.Entry<String, String> entry : cookies.entrySet())
{
if (buff.length() > 0)
buff.append("; ");

View File

@ -614,7 +614,7 @@ public class Server extends HandlerWrapper implements Attributes
{
encodedPathQuery = URIUtil.canonicalPath(URIUtil.addEncodedPaths(encodedContextPath, encodedPathQuery));
if (encodedPathQuery == null)
throw new BadMessageException(500,"Bad dispatch path");
throw new BadMessageException(500, "Bad dispatch path");
}
}

View File

@ -2214,7 +2214,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
if (!StringUtil.isEmpty(contextPath))
{
uri.path(URIUtil.addPaths(contextPath,uri.getPath()));
uri.path(URIUtil.addPaths(contextPath, uri.getPath()));
pathInfo = uri.getDecodedPath().substring(contextPath.length());
}
return new Dispatcher(ContextHandler.this, uri, pathInfo);

View File

@ -461,7 +461,7 @@ public class ErrorHandler extends AbstractHandler
{
Throwable cause = (Throwable)request.getAttribute(Dispatcher.ERROR_EXCEPTION);
Object servlet = request.getAttribute(Dispatcher.ERROR_SERVLET_NAME);
Map<String,String> json = new HashMap<>();
Map<String, String> json = new HashMap<>();
json.put("url", request.getRequestURI());
json.put("status", Integer.toString(code));

View File

@ -407,7 +407,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
if (data == null) //session doesn't exist
return null;
data.setLastNode(_context.getWorkerName());//we are going to manage the node
data.setLastNode(_context.getWorkerName()); //we are going to manage the node
session = newSession(data);
return session;
}
@ -573,7 +573,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
//reactivate the session
session.didActivate();
session.setResident(true);
doPutIfAbsent(id, session);//ensure it is in our map
doPutIfAbsent(id, session); //ensure it is in our map
if (LOG.isDebugEnabled())
LOG.debug("Session reactivated id={}", id);
}

View File

@ -732,22 +732,22 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
statement.setString(2, cp); //context path
statement.setString(3, _context.getVhost()); //first vhost
statement.setString(4, data.getLastNode());//my node id
statement.setLong(5, data.getAccessed());//accessTime
statement.setString(4, data.getLastNode()); //my node id
statement.setLong(5, data.getAccessed()); //accessTime
statement.setLong(6, data.getLastAccessed()); //lastAccessTime
statement.setLong(7, data.getCreated()); //time created
statement.setLong(8, data.getCookieSet());//time cookie was set
statement.setLong(8, data.getCookieSet()); //time cookie was set
statement.setLong(9, data.getLastSaved()); //last saved time
statement.setLong(10, data.getExpiry());
statement.setLong(11, data.getMaxInactiveMs());
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos))
ObjectOutputStream oos = new ObjectOutputStream(baos))
{
SessionData.serializeAttributes(data, oos);
byte[] bytes = baos.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
statement.setBinaryStream(12, bais, bytes.length);//attribute map as blob
statement.setBinaryStream(12, bais, bytes.length); //attribute map as blob
}
statement.executeUpdate();
@ -765,21 +765,21 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
connection.setAutoCommit(true);
try (PreparedStatement statement = _sessionTableSchema.getUpdateSessionStatement(connection, data.getId(), _context))
{
statement.setString(1, data.getLastNode());//should be my node id
statement.setLong(2, data.getAccessed());//accessTime
statement.setString(1, data.getLastNode()); //should be my node id
statement.setLong(2, data.getAccessed()); //accessTime
statement.setLong(3, data.getLastAccessed()); //lastAccessTime
statement.setLong(4, data.getLastSaved()); //last saved time
statement.setLong(5, data.getExpiry());
statement.setLong(6, data.getMaxInactiveMs());
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos))
ObjectOutputStream oos = new ObjectOutputStream(baos))
{
SessionData.serializeAttributes(data, oos);
byte[] bytes = baos.toByteArray();
try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes))
{
statement.setBinaryStream(7, bais, bytes.length);//attribute map as blob
statement.setBinaryStream(7, bais, bytes.length); //attribute map as blob
}
}
@ -819,7 +819,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
expiredSessionKeys.add(sessionId);
if (LOG.isDebugEnabled())
LOG.debug("{} - Found expired sessionId={}, in context={}, expiry={}",
_context.getWorkerName(), sessionId, _context.getCanonicalContextPath(),exp);
_context.getWorkerName(), sessionId, _context.getCanonicalContextPath(), exp);
}
}
}
@ -887,7 +887,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
_context.getVhost(), timeLimit))
{
if (LOG.isDebugEnabled())
LOG.debug("{}- Searching for sessions for context {} expired before {}",_context.getWorkerName(),_context.getCanonicalContextPath(), timeLimit);
LOG.debug("{}- Searching for sessions for context {} expired before {}", _context.getWorkerName(), _context.getCanonicalContextPath(), timeLimit);
try (ResultSet result = selectExpiredSessions.executeQuery())
{
@ -898,7 +898,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
expired.add(sessionId);
if (LOG.isDebugEnabled())
LOG.debug("{}- Found expired sessionId={} for context={} expiry={}",
_context.getWorkerName(),sessionId,_context.getCanonicalContextPath(), exp);
_context.getWorkerName(), sessionId, _context.getCanonicalContextPath(), exp);
}
}
}
@ -921,7 +921,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
connection.setAutoCommit(true);
int rows = statement.executeUpdate();
if (LOG.isDebugEnabled())
LOG.debug("Deleted {} orphaned sessions",rows);
LOG.debug("Deleted {} orphaned sessions", rows);
}
catch (Exception e)
{

View File

@ -461,10 +461,10 @@ public class SessionData implements Serializable
out.writeUTF(_id); //session id
out.writeUTF(_contextPath); //context path
out.writeUTF(_vhost); //first vhost
out.writeLong(_accessed);//accessTime
out.writeLong(_accessed); //accessTime
out.writeLong(_lastAccessed); //lastAccessTime
out.writeLong(_created); //time created
out.writeLong(_cookieSet);//time cookie was set
out.writeLong(_cookieSet); //time cookie was set
out.writeUTF(_lastNode); //name of last node managing
out.writeLong(_expiry);
out.writeLong(_maxInactiveMs);
@ -476,10 +476,10 @@ public class SessionData implements Serializable
_id = in.readUTF();
_contextPath = in.readUTF();
_vhost = in.readUTF();
_accessed = in.readLong();//accessTime
_accessed = in.readLong(); //accessTime
_lastAccessed = in.readLong(); //lastAccessTime
_created = in.readLong(); //time created
_cookieSet = in.readLong();//time cookie was set
_cookieSet = in.readLong(); //time cookie was set
_lastNode = in.readUTF(); //last managing node
_expiry = in.readLong();
_maxInactiveMs = in.readLong();

View File

@ -153,7 +153,7 @@ public class ClassLoaderDumpTest
{
Server server = new Server();
ClassLoader middleLoader = new URLClassLoader(new URL[]
{new URL("file:/one"), new URL("file:/two"), new URL("file:/three"),},
{new URL("file:/one"), new URL("file:/two"), new URL("file:/three")},
Server.class.getClassLoader())
{
public String toString()
@ -162,7 +162,7 @@ public class ClassLoaderDumpTest
}
};
ClassLoader loader = new URLClassLoader(new URL[]
{new URL("file:/ONE"), new URL("file:/TWO"), new URL("file:/THREE"),},
{new URL("file:/ONE"), new URL("file:/TWO"), new URL("file:/THREE")},
middleLoader)
{
public String toString()

View File

@ -898,9 +898,9 @@ public class MultiPartFormInputStreamTest
assertEquals("Joe Blow", new String(os.toByteArray()));
assertEquals(8, field1.getSize());
assertNotNull(((MultiPartFormInputStream.MultiPart)field1).getBytes());//in internal buffer
assertNotNull(((MultiPartFormInputStream.MultiPart)field1).getBytes()); //in internal buffer
field1.write("field1.txt");
assertNull(((MultiPartFormInputStream.MultiPart)field1).getBytes());//no longer in internal buffer
assertNull(((MultiPartFormInputStream.MultiPart)field1).getBytes()); //no longer in internal buffer
File f = new File(_dirname + File.separator + "field1.txt");
assertTrue(f.exists());
field1.write("another_field1.txt"); //write after having already written

View File

@ -108,7 +108,7 @@ public class PartialRFC2616Test
checkContains(get, 0, "Content-Type: text/html", "GET _content");
checkContains(get, 0, "<html>", "GET body");
int cli = get.indexOf("Content-Length");
String contentLength = get.substring(cli,get.indexOf("\r",cli));
String contentLength = get.substring(cli, get.indexOf("\r", cli));
String head = connector.getResponse("HEAD /R1 HTTP/1.0\n" + "Host: localhost\n" + "\n");
checkContains(head, 0, "HTTP/1.1 200", "HEAD");

View File

@ -1816,8 +1816,8 @@ public class RequestTest
{
String uri = "/foo/something";
Request request = new TestRequest(null, null);
request.getResponse().getHttpFields().add(new HttpCookie.SetCookieHttpField(new HttpCookie("good","thumbsup", 100), CookieCompliance.RFC6265));
request.getResponse().getHttpFields().add(new HttpCookie.SetCookieHttpField(new HttpCookie("bonza","bewdy", 1), CookieCompliance.RFC6265));
request.getResponse().getHttpFields().add(new HttpCookie.SetCookieHttpField(new HttpCookie("good", "thumbsup", 100), CookieCompliance.RFC6265));
request.getResponse().getHttpFields().add(new HttpCookie.SetCookieHttpField(new HttpCookie("bonza", "bewdy", 1), CookieCompliance.RFC6265));
request.getResponse().getHttpFields().add(new HttpCookie.SetCookieHttpField(new HttpCookie("bad", "thumbsdown", 0), CookieCompliance.RFC6265));
HttpFields.Mutable fields = HttpFields.build();
fields.add(HttpHeader.AUTHORIZATION, "Basic foo");
@ -2046,7 +2046,7 @@ public class RequestTest
@Override
public Cookie[] getCookies()
{
return new Cookie[] {c1,c2};
return new Cookie[] {c1, c2};
}
}

View File

@ -133,8 +133,8 @@ public class ContextHandlerGetResourceTest
public void testBadPath() throws Exception
{
final String path = "bad";
assertThrows(MalformedURLException.class,() -> context.getResource(path));
assertThrows(MalformedURLException.class,() -> context.getServletContext().getResource(path));
assertThrows(MalformedURLException.class, () -> context.getResource(path));
assertThrows(MalformedURLException.class, () -> context.getServletContext().getResource(path));
}
@Test

View File

@ -779,7 +779,7 @@ public class ServletHandler extends ScopedHandler
{
if (listeners != null)
initializeHolders(listeners);
updateBeans(_listeners,listeners);
updateBeans(_listeners, listeners);
_listeners = listeners;
}
@ -1466,7 +1466,7 @@ public class ServletHandler extends ScopedHandler
*/
public void setFilterMappings(FilterMapping[] filterMappings)
{
updateBeans(_filterMappings,filterMappings);
updateBeans(_filterMappings, filterMappings);
_filterMappings = filterMappings;
if (isRunning())
updateMappings();
@ -1480,7 +1480,7 @@ public class ServletHandler extends ScopedHandler
if (holders != null)
initializeHolders(holders);
updateBeans(_filters,holders);
updateBeans(_filters, holders);
_filters = holders;
updateNameMappings();
invalidateChainsCache();
@ -1492,7 +1492,7 @@ public class ServletHandler extends ScopedHandler
*/
public void setServletMappings(ServletMapping[] servletMappings)
{
updateBeans(_servletMappings,servletMappings);
updateBeans(_servletMappings, servletMappings);
_servletMappings = servletMappings;
if (isRunning())
updateMappings();
@ -1510,7 +1510,7 @@ public class ServletHandler extends ScopedHandler
{
if (holders != null)
initializeHolders(holders);
updateBeans(_servlets,holders);
updateBeans(_servlets, holders);
_servlets = holders;
updateNameMappings();
invalidateChainsCache();

View File

@ -706,7 +706,7 @@ public class AsyncServletTest
// ignored
}
historyAdd(request.getDispatcherType() + " " + URIUtil.addPathQuery(request.getRequestURI(),request.getQueryString()));
historyAdd(request.getDispatcherType() + " " + URIUtil.addPathQuery(request.getRequestURI(), request.getQueryString()));
if (request instanceof ServletRequestWrapper || response instanceof ServletResponseWrapper)
historyAdd("wrapped" + ((request instanceof ServletRequestWrapper) ? " REQ" : "") + ((response instanceof ServletResponseWrapper) ? " RSP" : ""));

View File

@ -510,10 +510,10 @@ public class ServletHandlerTest
mappings = handler.getFilterMappings();
assertNotNull(mappings);
assertEquals(4, mappings.length);
assertTrue(fm4 == mappings[0]);//isMatchAfter = false;
assertTrue(fm5 == mappings[1]);//isMatchAfter = false;
assertTrue(fm1 == mappings[2]);//ordinary
assertTrue(fm3 == mappings[3]);//isMatchAfter = true;
assertTrue(fm4 == mappings[0]); //isMatchAfter = false;
assertTrue(fm5 == mappings[1]); //isMatchAfter = false;
assertTrue(fm1 == mappings[2]); //ordinary
assertTrue(fm3 == mappings[3]); //isMatchAfter = true;
//add a non-programmatic one
FilterHolder f = new FilterHolder(Source.EMBEDDED);
@ -563,7 +563,7 @@ public class ServletHandlerTest
assertEquals(7, mappings.length);
assertTrue(fm4 == mappings[0]); //isMatchAfter = false;
assertTrue(fm5 == mappings[1]); //isMatchAfter = false;
assertTrue(pfm2 == mappings[2]);//isMatchAfter = false;
assertTrue(pfm2 == mappings[2]); //isMatchAfter = false;
assertTrue(fm1 == mappings[3]); //ordinary
assertTrue(fm == mappings[4]); //ordinary
assertTrue(fm3 == mappings[5]); //isMatchAfter = true;
@ -613,10 +613,10 @@ public class ServletHandlerTest
mappings = handler.getFilterMappings();
assertNotNull(mappings);
assertEquals(4, mappings.length);
assertTrue(fh4 == mappings[0].getFilterHolder());//isMatchAfter = false;
assertTrue(fh5 == mappings[1].getFilterHolder());//isMatchAfter = false;
assertTrue(fh1 == mappings[2].getFilterHolder());//ordinary
assertTrue(fh3 == mappings[3].getFilterHolder());//isMatchAfter = true;
assertTrue(fh4 == mappings[0].getFilterHolder()); //isMatchAfter = false;
assertTrue(fh5 == mappings[1].getFilterHolder()); //isMatchAfter = false;
assertTrue(fh1 == mappings[2].getFilterHolder()); //ordinary
assertTrue(fh3 == mappings[3].getFilterHolder()); //isMatchAfter = true;
//add a non-programmatic one
FilterHolder f = new FilterHolder(Source.EMBEDDED);
@ -662,7 +662,7 @@ public class ServletHandlerTest
assertEquals(7, mappings.length);
assertTrue(fh4 == mappings[0].getFilterHolder()); //isMatchAfter = false;
assertTrue(fh5 == mappings[1].getFilterHolder()); //isMatchAfter = false;
assertTrue(pf2 == mappings[2].getFilterHolder());//isMatchAfter = false;
assertTrue(pf2 == mappings[2].getFilterHolder()); //isMatchAfter = false;
assertTrue(fh1 == mappings[3].getFilterHolder()); //ordinary
assertTrue(f == mappings[4].getFilterHolder()); //ordinary
assertTrue(fh3 == mappings[5].getFilterHolder()); //isMatchAfter = true;

View File

@ -61,7 +61,7 @@ public class ServletLifeCycleTest
ServletHandler sh = context.getServletHandler();
sh.addListener(new ListenerHolder(TestListener.class)); //added directly to ServletHandler
context.addEventListener(context.getServletContext().createListener(TestListener2.class));//create,decorate and add listener to context - no holder!
context.addEventListener(context.getServletContext().createListener(TestListener2.class)); //create,decorate and add listener to context - no holder!
sh.addFilterWithMapping(TestFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
sh.addFilterWithMapping(new FilterHolder(context.getServletContext().createFilter(TestFilter2.class)), "/*", EnumSet.of(DispatcherType.REQUEST));

View File

@ -599,6 +599,6 @@ public class ServletRequestLogTest
private void assertRequestLog(final String expectedLogEntry, CaptureLog captureLog)
{
assertThat("Request log size", captureLog.captured, not(empty()));
assertThat("Request log entry",captureLog.captured.get(0), is(expectedLogEntry));
assertThat("Request log entry", captureLog.captured.get(0), is(expectedLogEntry));
}
}

View File

@ -94,7 +94,7 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
// Simple command line - no reference to include-jetty-dirs
@ -124,7 +124,7 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
// Simple command line reference to include-jetty-dir
@ -158,7 +158,7 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
// Simple command line reference to include-jetty-dir via property (also on command line)
@ -198,7 +198,7 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
String dirRef = "${my.opt}" + File.separator + "common";
@ -240,7 +240,7 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
String dirRef = "${my.opt}" + File.separator + "${my.dir}";
@ -280,8 +280,8 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
MainResult result = runMain(base, home);
@ -316,9 +316,9 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
"--include-jetty-dir=" + common.toString(), //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString(),
"--include-jetty-dir=" + corp.toString());
MainResult result = runMain(base, home);
@ -350,15 +350,15 @@ public class IncludeJettyDirTest
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"--include-jetty-dir=" + corp.toString(), //
TestEnv.makeFile(common, "start.ini",
"--include-jetty-dir=" + corp.toString(),
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
MainResult result = runMain(base, home);
@ -385,23 +385,23 @@ public class IncludeJettyDirTest
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"my.corp=" + corp.toString(), //
"--include-jetty-dir=${my.corp}", //
TestEnv.makeFile(common, "start.ini",
"my.corp=" + corp.toString(),
"--include-jetty-dir=${my.corp}",
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
"my.common=" + common.toString(), //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"my.common=" + common.toString(),
"--include-jetty-dir=${my.common}");
MainResult result = runMain(base, home);
@ -428,28 +428,28 @@ public class IncludeJettyDirTest
// Create devops
Path devops = testdir.getPathFile("devops");
FS.ensureEmpty(devops);
TestEnv.makeFile(devops, "start.ini", //
"--module=optional", //
TestEnv.makeFile(devops, "start.ini",
"--module=optional",
"jetty.http.port=2222");
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"--include-jetty-dir=" + corp.toString(), //
TestEnv.makeFile(common, "start.ini",
"--include-jetty-dir=" + corp.toString(),
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
MainResult result = runMain(base, home,
@ -479,21 +479,21 @@ public class IncludeJettyDirTest
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"--include-jetty-dir=" + corp.toString(), //
TestEnv.makeFile(common, "start.ini",
"--include-jetty-dir=" + corp.toString(),
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
MainResult result = runMain(base, home,
@ -542,8 +542,8 @@ public class IncludeJettyDirTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
UsageException e = assertThrows(UsageException.class, () -> runMain(base, home));

View File

@ -88,7 +88,7 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
ConfigSources sources = new ConfigSources();
@ -117,8 +117,8 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
ConfigSources sources = new ConfigSources();
@ -147,7 +147,7 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
ConfigSources sources = new ConfigSources();
@ -193,7 +193,7 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
String dirRef = "${my.opt}" + File.separator + "common";
@ -240,7 +240,7 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1");
String dirRef = "${my.opt}" + File.separator + "${my.dir}";
@ -286,8 +286,8 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
ConfigSources sources = new ConfigSources();
@ -325,9 +325,9 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
"--include-jetty-dir=" + common.toString(), //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString(),
"--include-jetty-dir=" + corp.toString());
ConfigSources sources = new ConfigSources();
@ -359,21 +359,21 @@ public class ConfigSourcesTest
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"--include-jetty-dir=" + corp.toString(), //
TestEnv.makeFile(common, "start.ini",
"--include-jetty-dir=" + corp.toString(),
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
ConfigSources sources = new ConfigSources();
@ -405,23 +405,23 @@ public class ConfigSourcesTest
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"my.corp=" + corp.toString(), //
"--include-jetty-dir=${my.corp}", //
TestEnv.makeFile(common, "start.ini",
"my.corp=" + corp.toString(),
"--include-jetty-dir=${my.corp}",
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
"my.common=" + common.toString(), //
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"my.common=" + common.toString(),
"--include-jetty-dir=${my.common}");
ConfigSources sources = new ConfigSources();
@ -454,28 +454,28 @@ public class ConfigSourcesTest
// Create devops
Path devops = testdir.getPathFile("devops");
FS.ensureEmpty(devops);
TestEnv.makeFile(devops, "start.ini", //
"--module=logging", //
TestEnv.makeFile(devops, "start.ini",
"--module=logging",
"jetty.http.port=2222");
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"--include-jetty-dir=" + corp.toString(), //
TestEnv.makeFile(common, "start.ini",
"--include-jetty-dir=" + corp.toString(),
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
ConfigSources sources = new ConfigSources();
@ -512,21 +512,21 @@ public class ConfigSourcesTest
// Create corp
Path corp = testdir.getPathFile("corp");
FS.ensureEmpty(corp);
TestEnv.makeFile(corp, "start.ini", //
TestEnv.makeFile(corp, "start.ini",
"jetty.http.port=9090");
// Create common
Path common = testdir.getPathFile("common");
FS.ensureEmpty(common);
TestEnv.makeFile(common, "start.ini", //
"--include-jetty-dir=" + corp.toString(), //
TestEnv.makeFile(common, "start.ini",
"--include-jetty-dir=" + corp.toString(),
"jetty.http.port=8080");
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
ConfigSources sources = new ConfigSources();
@ -581,8 +581,8 @@ public class ConfigSourcesTest
// Create base
Path base = testdir.getPathFile("base");
FS.ensureEmpty(base);
TestEnv.makeFile(base, "start.ini", //
"jetty.http.host=127.0.0.1",//
TestEnv.makeFile(base, "start.ini",
"jetty.http.host=127.0.0.1",
"--include-jetty-dir=" + common.toString());
ConfigSources sources = new ConfigSources();

View File

@ -70,12 +70,12 @@ class ArrayTrie<V> extends AbstractTrie<V>
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/*0*/ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
/*1*/ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
/*2*/ -1, -2, -3, -4, -5, -6, -7, -8, -9,-10,-11, 43, 44, 45, 46, 47,
/*2*/ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, 43, 44, 45, 46, 47,
/*3*/ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 37, 38, 39, 40, 41, 42,
/*4*/-12, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
/*5*/ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,-13,-14,-15,-16, 36,
/*5*/ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -13, -14, -15, -16, 36,
/*6*/-17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
/*7*/ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,-18,-19,-20,-21, X,
/*7*/ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -18, -19, -20, -21, X,
};
/**
@ -91,12 +91,12 @@ class ArrayTrie<V> extends AbstractTrie<V>
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/*0*/ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
/*1*/ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
/*2*/ -1, -2, -3, -4, -5, -6, -7, -8, -9,-10,-11, 43, 44, 45, 46, 47,
/*2*/ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, 43, 44, 45, 46, 47,
/*3*/ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 37, 38, 39, 40, 41, 42,
/*4*/-12,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-36,
/*5*/-37,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-13,-14,-15,-16, 36,
/*4*/-12, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -32, -33, -34, -35, -36,
/*5*/-37, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -13, -14, -15, -16, 36,
/*6*/-17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
/*7*/ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,-18,-19,-20,-21, X,
/*7*/ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -18, -19, -20, -21, X,
};
/**

View File

@ -151,10 +151,10 @@ public class Scanner extends AbstractLifeCycle
private class Visitor implements FileVisitor<Path>
{
Map<String, MetaData> scanInfoMap;
IncludeExcludeSet<PathMatcher,Path> rootIncludesExcludes;
IncludeExcludeSet<PathMatcher, Path> rootIncludesExcludes;
Path root;
public Visitor(Path root, IncludeExcludeSet<PathMatcher,Path> rootIncludesExcludes, Map<String, MetaData> scanInfoMap)
public Visitor(Path root, IncludeExcludeSet<PathMatcher, Path> rootIncludesExcludes, Map<String, MetaData> scanInfoMap)
{
this.root = root;
this.rootIncludesExcludes = rootIncludesExcludes;
@ -640,7 +640,7 @@ public class Scanner extends AbstractLifeCycle
{
try
{
Files.walkFileTree(entry.getKey(), EnumSet.allOf(FileVisitOption.class),_scanDepth,
Files.walkFileTree(entry.getKey(), EnumSet.allOf(FileVisitOption.class), _scanDepth,
new Visitor(entry.getKey(), entry.getValue(), currentScan));
}
catch (IOException e)

View File

@ -175,7 +175,7 @@ public class FutureCallbackTest
latch.await();
long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
CancellationException e = assertThrows(CancellationException.class,() -> fcb.get(10000, TimeUnit.MILLISECONDS));
CancellationException e = assertThrows(CancellationException.class, () -> fcb.get(10000, TimeUnit.MILLISECONDS));
assertThat(e.getCause(), Matchers.instanceOf(CancellationException.class));
assertThat(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start, Matchers.greaterThan(10L));

View File

@ -219,11 +219,13 @@ public class SearchPatternTest
public void testExampleFrom4673()
{
SearchPattern pattern = SearchPattern.compile("\r\n------WebKitFormBoundaryhXfFAMfUnUKhmqT8".getBytes(StandardCharsets.US_ASCII));
byte[] data = new byte[]{118,97,108,117,101,49,
'\r','\n','-','-','-','-',
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0};
byte[] data = new byte[]{
118, 97, 108, 117, 101, 49,
'\r', '\n', '-', '-', '-', '-',
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
int length = 12;
int partialMatch = pattern.endsWith(data, 0, length);

View File

@ -93,7 +93,7 @@ public class TrieTest
for (boolean caseSensitive : new boolean[] {true, false})
{
impls.add(new ArrayTrie<Integer>(caseSensitive,128));
impls.add(new ArrayTrie<Integer>(caseSensitive, 128));
impls.add(new ArrayTernaryTrie<Integer>(caseSensitive, 128));
impls.add(new TreeTrie<>(caseSensitive));
}

View File

@ -68,7 +68,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name1=Value1", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "simple param size");
assertEquals("Name1=Value1", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "simple encode");
assertEquals("Name1=Value1", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "simple encode");
assertEquals("Value1", urlEncoded.getString("Name1"), "simple get");
}));
@ -78,7 +78,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name2=", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "dangling param size");
assertEquals("Name2", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "dangling encode");
assertEquals("Name2", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "dangling encode");
assertEquals("", urlEncoded.getString("Name2"), "dangling get");
}));
@ -88,7 +88,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name3", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "noValue param size");
assertEquals("Name3", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "noValue encode");
assertEquals("Name3", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "noValue encode");
assertEquals("", urlEncoded.getString("Name3"), "noValue get");
}));
@ -98,7 +98,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name4=V\u0629lue+4%21", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "encoded param size");
assertEquals("Name4=V%D8%A9lue+4%21", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("Name4=V%D8%A9lue+4%21", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("V\u0629lue 4!", urlEncoded.getString("Name4"), "encoded get");
}));
@ -108,7 +108,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name4=Value%2B4%21", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "encoded param size");
assertEquals("Name4=Value%2B4%21", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("Name4=Value%2B4%21", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("Value+4!", urlEncoded.getString("Name4"), "encoded get");
}));
@ -118,7 +118,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name4=Value+4%21%20%214", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "encoded param size");
assertEquals("Name4=Value+4%21+%214", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("Name4=Value+4%21+%214", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("Value 4! !4", urlEncoded.getString("Name4"), "encoded get");
}));
@ -128,9 +128,9 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name5=aaa&Name6=bbb", urlEncoded, UrlEncoded.ENCODING);
assertEquals(2, urlEncoded.size(), "multi param size");
assertTrue(UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false).equals("Name5=aaa&Name6=bbb") ||
UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false).equals("Name6=bbb&Name5=aaa"),
"multi encode " + UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false));
assertTrue(UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false).equals("Name5=aaa&Name6=bbb") ||
UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false).equals("Name6=bbb&Name5=aaa"),
"multi encode " + UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false));
assertEquals("aaa", urlEncoded.getString("Name5"), "multi get");
assertEquals("bbb", urlEncoded.getString("Name6"), "multi get");
}));
@ -140,7 +140,7 @@ public class URLEncodedTest
MultiMap<String> urlEncoded = new MultiMap<>();
urlEncoded.clear();
UrlEncoded.decodeTo("Name7=aaa&Name7=b%2Cb&Name7=ccc", urlEncoded, UrlEncoded.ENCODING);
assertEquals("Name7=aaa&Name7=b%2Cb&Name7=ccc", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "multi encode");
assertEquals("Name7=aaa&Name7=b%2Cb&Name7=ccc", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "multi encode");
assertEquals("aaa,b,b,ccc", urlEncoded.getString("Name7"), "list get all");
assertEquals("aaa", urlEncoded.getValues("Name7").get(0), "list get");
assertEquals("b,b", urlEncoded.getValues("Name7").get(1), "list get");
@ -153,7 +153,7 @@ public class URLEncodedTest
urlEncoded.clear();
UrlEncoded.decodeTo("Name8=xx%2C++yy++%2Czz", urlEncoded, UrlEncoded.ENCODING);
assertEquals(1, urlEncoded.size(), "encoded param size");
assertEquals("Name8=xx%2C++yy++%2Czz", UrlEncoded.encode(urlEncoded,UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("Name8=xx%2C++yy++%2Czz", UrlEncoded.encode(urlEncoded, UrlEncoded.ENCODING, false), "encoded encode");
assertEquals("xx, yy ,zz", urlEncoded.getString("Name8"), "encoded get");
}));

View File

@ -192,7 +192,7 @@ public class JarResourceTest
Path testJar = MavenTestingUtils.getTestResourcePathFile("jar-file-resource.jar");
String uri = "jar:" + testJar.toUri().toASCIIString() + "!/";
Resource resource = new JarFileResource(URI.create(uri).toURL(),false);
Resource resource = new JarFileResource(URI.create(uri).toURL(), false);
Resource rez = resource.addPath("rez/");
assertThat("path /rez/ is a dir", rez.isDirectory(), is(true));
@ -220,7 +220,7 @@ public class JarResourceTest
Path testJar = MavenTestingUtils.getTestResourcePathFile("jar-file-resource.jar");
String uri = "jar:" + testJar.toUri().toASCIIString() + "!/";
Resource resource = new JarFileResource(URI.create(uri).toURL(),false);
Resource resource = new JarFileResource(URI.create(uri).toURL(), false);
Resource rez = resource.addPath("rez/oddities/");
assertThat("path /rez/oddities/ is a dir", rez.isDirectory(), is(true));
@ -244,7 +244,7 @@ public class JarResourceTest
Path testJar = MavenTestingUtils.getTestResourcePathFile("jar-file-resource.jar");
String uri = "jar:" + testJar.toUri().toASCIIString() + "!/";
Resource resource = new JarFileResource(URI.create(uri).toURL(),false);
Resource resource = new JarFileResource(URI.create(uri).toURL(), false);
Resource anotherDir = resource.addPath("rez/another dir/");
assertThat("path /rez/another dir/ is a dir", anotherDir.isDirectory(), is(true));

View File

@ -56,7 +56,7 @@ public class MetaData
protected final List<Resource> _webInfJars = new ArrayList<>();
protected final List<Resource> _orderedContainerResources = new ArrayList<>();
protected final List<Resource> _orderedWebInfResources = new ArrayList<>();
protected Ordering _ordering;//can be set to RelativeOrdering by web-default.xml, web.xml, web-override.xml
protected Ordering _ordering; //can be set to RelativeOrdering by web-default.xml, web.xml, web-override.xml
protected boolean _allowDuplicateFragmentNames = false;
protected boolean _validateXml = false;
@ -492,7 +492,7 @@ public class MetaData
List<Resource> resources = new ArrayList<>();
resources.add(EmptyResource.INSTANCE); //always apply annotations with no resource first
resources.addAll(_orderedContainerResources); //next all annotations from container path
resources.addAll(_webInfClasses);//next everything from web-inf classes
resources.addAll(_webInfClasses); //next everything from web-inf classes
resources.addAll(getWebInfResources(isOrdered())); //finally annotations (in order) from webinf path
for (Resource r : resources)

View File

@ -82,7 +82,7 @@ public class AutobahnTests
try (GenericContainer<?> container = new GenericContainer<>(DockerImageName.parse("jettyproject/autobahn-testsuite:latest"))
.withCommand("/bin/bash", "-c", "wstest -m fuzzingserver -s /config/fuzzingserver.json")
.withExposedPorts(9001)
.withCopyFileToContainer(MountableFile.forHostPath(fuzzingServer),"/config/fuzzingserver.json")
.withCopyFileToContainer(MountableFile.forHostPath(fuzzingServer), "/config/fuzzingserver.json")
.withLogConsumer(new Slf4jLogConsumer(LOG))
.withStartupTimeout(Duration.ofHours(2)))
{
@ -115,7 +115,7 @@ public class AutobahnTests
try (GenericContainer<?> container = new GenericContainer<>(DockerImageName.parse("jettyproject/autobahn-testsuite:latest"))
.withCommand("/bin/bash", "-c", "wstest -m fuzzingclient -s /config/fuzzingclient.json" + FileSignalWaitStrategy.END_COMMAND)
.withLogConsumer(new Slf4jLogConsumer(LOG))
.withCopyFileToContainer(MountableFile.forHostPath(fuzzingClient),"/config/fuzzingclient.json")
.withCopyFileToContainer(MountableFile.forHostPath(fuzzingClient), "/config/fuzzingclient.json")
.withStartupCheckStrategy(strategy)
.withStartupTimeout(Duration.ofHours(2)))
{
@ -240,7 +240,7 @@ public class AutobahnTests
if (r.failed())
{
addFailure(testcase,r);
addFailure(testcase, r);
failures++;
}
root.addChild(testcase);

View File

@ -234,7 +234,7 @@ class WebSocketProxy
}
if (failServer2Proxy)
server2Proxy.fail(failure,callback);
server2Proxy.fail(failure, callback);
else
callback.failed(failure);
}
@ -379,7 +379,7 @@ class WebSocketProxy
try
{
state = State.CONNECTING;
client.connect(this, serverUri).whenComplete((s,t) ->
client.connect(this, serverUri).whenComplete((s, t) ->
{
if (t != null)
onConnectFailure(t, callback);
@ -572,7 +572,7 @@ class WebSocketProxy
}
if (failClient2Proxy)
client2Proxy.fail(failure,callback);
client2Proxy.fail(failure, callback);
else
callback.failed(failure);
}

View File

@ -430,7 +430,7 @@ public class XmlParser
if (LOG.isDebugEnabled())
LOG.warn("SAX Parse Issue", ex);
else
LOG.warn("SAX Parse Issue @{} : {}",getLocationString(ex), ex.toString());
LOG.warn("SAX Parse Issue @{} : {}", getLocationString(ex), ex.toString());
}
@Override
@ -442,7 +442,7 @@ public class XmlParser
if (LOG.isDebugEnabled())
LOG.error("SAX Parse Issue", ex);
else
LOG.error("SAX Parse Issue @{} : {}",getLocationString(ex), ex.toString());
LOG.error("SAX Parse Issue @{} : {}", getLocationString(ex), ex.toString());
}
@Override

View File

@ -86,11 +86,11 @@ public class ConnectionPoolsBenchmark
pool.preCreateConnections(initialConnections).get();
break;
case "uncached/multiplex":
pool = new MultiplexConnectionPool(httpDestination, maxConnections,false, Callback.NOOP, 12);
pool = new MultiplexConnectionPool(httpDestination, maxConnections, false, Callback.NOOP, 12);
pool.preCreateConnections(initialConnections).get();
break;
case "cached/multiplex":
pool = new MultiplexConnectionPool(httpDestination, maxConnections,true, Callback.NOOP, 12);
pool = new MultiplexConnectionPool(httpDestination, maxConnections, true, Callback.NOOP, 12);
pool.preCreateConnections(initialConnections).get();
break;
case "round-robin":

View File

@ -63,9 +63,9 @@ public class DynamicListenerTests
}
Files.copy(Paths.get("src/test/resources/realm.ini"),
Paths.get(jettyBase.toString(),"start.d").resolve("realm.ini"));
Paths.get(jettyBase.toString(), "start.d").resolve("realm.ini"));
Files.copy(Paths.get("src/test/resources/realm.properties"),
etc.resolve("realm.properties"));
etc.resolve("realm.properties"));
Files.copy(Paths.get("src/test/resources/test-realm.xml"),
etc.resolve("test-realm.xml"));

View File

@ -113,7 +113,7 @@ public class HttpInputIntegrationTest
SslConnectionFactory ssl = new SslConnectionFactory(__sslContextFactory, h1.getProtocol() /*TODO alpn.getProtocol()*/);
// HTTP/2 Connector
ServerConnector http2 = new ServerConnector(__server, ssl,/*TODO alpn,h2,*/ h1);
ServerConnector http2 = new ServerConnector(__server, ssl, /*TODO alpn,h2,*/ h1);
http2.setIdleTimeout(5000);
__server.addConnector(http2);

View File

@ -111,7 +111,7 @@ public class SerializedInfinispanSessionDataStoreTest extends AbstractSessionDat
((InfinispanSessionDataStore)store).setCache(null);
//test that loading it fails
assertThrows(UnreadableSessionDataException.class,() -> store.load("222"));
assertThrows(UnreadableSessionDataException.class, () -> store.load("222"));
}
@Override

View File

@ -65,14 +65,14 @@ public class RemoteInfinispanTestSupport
String infinispanVersion = System.getProperty("infinispan.docker.image.version", "9.4.8.Final");
infinispan =
new GenericContainer(System.getProperty("infinispan.docker.image.name", "jboss/infinispan-server") +
":" + infinispanVersion)
.withEnv("APP_USER","theuser")
.withEnv("APP_PASS","foobar")
":" + infinispanVersion)
.withEnv("APP_USER", "theuser")
.withEnv("APP_PASS", "foobar")
.withEnv("MGMT_USER", "admin")
.withEnv("MGMT_PASS", "admin")
.waitingFor(new LogMessageWaitStrategy()
.withRegEx(".*Infinispan Server.*started in.*\\s"))
.withExposedPorts(4712,4713,8088,8089,8443,9990,9993,11211,11222,11223,11224)
.withRegEx(".*Infinispan Server.*started in.*\\s"))
.withExposedPorts(4712, 4713, 8088, 8089, 8443, 9990, 9993, 11211, 11222, 11223, 11224)
.withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
infinispan.start();
String host = infinispan.getContainerIpAddress();
@ -155,7 +155,7 @@ public class RemoteInfinispanTestSupport
public void setup() throws Exception
{
_cache = _manager.administration().getOrCreateCache(_name,(String)null);
_cache = _manager.administration().getOrCreateCache(_name, (String)null);
}
public void teardown() throws Exception

View File

@ -83,7 +83,7 @@ public class ClusteredSessionMigrationTest extends AbstractTestBase
cacheFactory2.setSaveOnCreate(true);
SessionDataStoreFactory storeFactory2 = createSessionDataStoreFactory();
TestServer server2 = new TestServer(0,TestServer.DEFAULT_MAX_INACTIVE, TestServer.DEFAULT_SCAVENGE_SEC,
TestServer server2 = new TestServer(0, TestServer.DEFAULT_MAX_INACTIVE, TestServer.DEFAULT_SCAVENGE_SEC,
cacheFactory2, storeFactory2);
server2.addContext(contextPath).addServlet(TestServlet.class, servletMapping);

View File

@ -259,7 +259,7 @@ public class SessionTableSchemaTest
id,
sc);
s.setString(1, "0");//should be my node id
s.setString(1, "0"); //should be my node id
s.setLong(2, System.currentTimeMillis());
s.setLong(3, System.currentTimeMillis());
s.setLong(4, System.currentTimeMillis());
@ -268,7 +268,7 @@ public class SessionTableSchemaTest
byte[] bytes = new byte[3];
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
s.setBinaryStream(7, bais, bytes.length);//attribute map as blob
s.setBinaryStream(7, bais, bytes.length); //attribute map as blob
assertEquals(1, s.executeUpdate());
}

View File

@ -130,7 +130,7 @@ public abstract class AbstractSessionDataStoreTest
Class fooclazz = Class.forName("Foo", true, _contextClassLoader);
//create a session
long now = System.currentTimeMillis();
data = store.newSessionData("aaa1", 100, now, now - 1, -1);//never expires
data = store.newSessionData("aaa1", 100, now, now - 1, -1); //never expires
data.setLastNode(sessionContext.getWorkerName());
//Make an attribute that uses the class only known to the webapp classloader
@ -190,7 +190,7 @@ public abstract class AbstractSessionDataStoreTest
//create a session
final long now = System.currentTimeMillis();
SessionData data = store.newSessionData("aaa2", 100, 200, 199, -1);//never expires
SessionData data = store.newSessionData("aaa2", 100, 200, 199, -1); //never expires
data.setAttribute("a", "b");
data.setLastNode(sessionContext.getWorkerName());
data.setLastSaved(400); //make it look like it was previously saved by the store
@ -242,7 +242,7 @@ public abstract class AbstractSessionDataStoreTest
Class factoryclazz = Class.forName("ProxyableFactory", true, _contextClassLoader);
//create a session
long now = System.currentTimeMillis();
data = store.newSessionData("aaa3", 100, now, now - 1, -1);//never expires
data = store.newSessionData("aaa3", 100, now, now - 1, -1); //never expires
data.setLastNode(sessionContext.getWorkerName());
Method m = factoryclazz.getMethod("newProxyable", ClassLoader.class);
Object proxy = m.invoke(null, _contextClassLoader);
@ -311,7 +311,7 @@ public abstract class AbstractSessionDataStoreTest
//persist a session that is not expired
long now = System.currentTimeMillis();
SessionData data = store.newSessionData("aaa4", 100, now, now - 1, -1);//never expires
SessionData data = store.newSessionData("aaa4", 100, now, now - 1, -1); //never expires
data.setLastNode(sessionContext.getWorkerName());
persistSession(data);
@ -344,7 +344,7 @@ public abstract class AbstractSessionDataStoreTest
//persist a session that is expired
long now = System.currentTimeMillis();
SessionData data = store.newSessionData("aaa5", 100, now - 20, now - 30, 10);//10 sec max idle
SessionData data = store.newSessionData("aaa5", 100, now - 20, now - 30, 10); //10 sec max idle
data.setLastNode(sessionContext.getWorkerName());
data.setExpiry(RECENT_TIMESTAMP); //make it expired recently
persistSession(data);

View File

@ -162,7 +162,7 @@ public abstract class AbstractSessionCacheTest
SessionCache cache = cacheFactory.getSessionCache(context.getSessionHandler());
//prefill the datastore with a session that will be treated as unreadable
UnreadableSessionDataStore store = new UnreadableSessionDataStore(1, new SessionData("1234", "/test", "0.0.0.0", System.currentTimeMillis(), 0,0, -1));
UnreadableSessionDataStore store = new UnreadableSessionDataStore(1, new SessionData("1234", "/test", "0.0.0.0", System.currentTimeMillis(), 0, 0, -1));
cache.setSessionDataStore(store);
context.getSessionHandler().setSessionCache(cache);
server.start();
@ -209,7 +209,7 @@ public abstract class AbstractSessionCacheTest
cacheFactory.setEvictionPolicy(SessionCache.NEVER_EVICT);
DefaultSessionCache cache = (DefaultSessionCache)cacheFactory.getSessionCache(context.getSessionHandler());
TestSessionDataStore store = new TestSessionDataStore(true);//fake passivation
TestSessionDataStore store = new TestSessionDataStore(true); //fake passivation
cache.setSessionDataStore(store);
context.getSessionHandler().setSessionCache(cache);
@ -289,14 +289,14 @@ public abstract class AbstractSessionCacheTest
store._numSaves.set(0); //clear save counter
Session session = createUnExpiredSession(cache, store, "1234");
cache.add("1234", session);
session.getSessionData().setLastSaved(100);//simulate previously saved
session.getSessionData().setLastSaved(100); //simulate previously saved
commitAndCheckSaveState(cache, store, session, false, true, false, true, 0, 0);
//call commit: session has changed, should be written
store._numSaves.set(0); //clear save counter
session = createUnExpiredSession(cache, store, "456");
cache.add("456", session);
session.getSessionData().setLastSaved(100);//simulate previously saved
session.getSessionData().setLastSaved(100); //simulate previously saved
session.setAttribute("foo", "bar");
commitAndCheckSaveState(cache, store, session, true, true, false, false, 0, 1);
@ -304,7 +304,7 @@ public abstract class AbstractSessionCacheTest
store._numSaves.set(0); //clear save counter
session = createUnExpiredSession(cache, store, "678");
cache.add("678", session);
session.getSessionData().setLastSaved(100);//simulate previously saved
session.getSessionData().setLastSaved(100); //simulate previously saved
session.getSessionData().calcAndSetExpiry(System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1));
commitAndCheckSaveState(cache, store, session, false, true, false, true, 0, 0);
@ -318,14 +318,14 @@ public abstract class AbstractSessionCacheTest
store._numSaves.set(0); //clear save counter
session = createUnExpiredSession(cache, store, "890");
cache.add("890", session);
session.getSessionData().setLastSaved(100);//simulate previously saved
session.getSessionData().setLastSaved(100); //simulate previously saved
commitAndCheckSaveState(cache, store, session, false, true, false, true, 0, 0);
//call commit: session has changed so session must be written
store._numSaves.set(0); //clear save counter
session = createUnExpiredSession(cache, store, "012");
cache.add("012", session);
session.getSessionData().setLastSaved(100);//simulate previously saved
session.getSessionData().setLastSaved(100); //simulate previously saved
session.setAttribute("foo", "bar");
commitAndCheckSaveState(cache, store, session, true, true, false, false, 0, 1);
@ -334,7 +334,7 @@ public abstract class AbstractSessionCacheTest
session = createUnExpiredSession(cache, store, "234");
session.getSessionData().setMetaDataDirty(true);
cache.add("234", session);
session.getSessionData().setLastSaved(100);//simulate previously saved
session.getSessionData().setLastSaved(100); //simulate previously saved
session.getSessionData().calcAndSetExpiry(System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1));
commitAndCheckSaveState(cache, store, session, false, true, false, true, 0, 0);
}
@ -380,7 +380,7 @@ public abstract class AbstractSessionCacheTest
session = createUnExpiredSession(cache, store, "456");
cache.add("456", session);
session.setAttribute("foo", "bar");
session.getSessionData().setLastSaved(100);//simulate not "new" session, ie has been previously saved
session.getSessionData().setLastSaved(100); //simulate not "new" session, ie has been previously saved
commitAndCheckSaveState(cache, store, session, true, true, false, false, 0, 1);
//call release: session not dirty but release changes metadata, so it will be saved
cache.release("456", session);
@ -421,7 +421,7 @@ public abstract class AbstractSessionCacheTest
store._numSaves.set(0); //clear save counter
session = createUnExpiredSession(cache, store, "012");
cache.add("012", session);
session.getSessionData().setLastSaved(100);//simulate previously saved session
session.getSessionData().setLastSaved(100); //simulate previously saved session
session.setAttribute("foo", "bar");
session.getSessionData().setMetaDataDirty(false);
commitAndCheckSaveState(cache, store, session, true, false, false, false, 0, 1);
@ -435,7 +435,7 @@ public abstract class AbstractSessionCacheTest
store._numSaves.set(0); //clear save counter
session = createUnExpiredSession(cache, store, "234");
session.getSessionData().calcAndSetExpiry(System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1));
session.getSessionData().setLastSaved(System.currentTimeMillis());//simulate session last saved recently
session.getSessionData().setLastSaved(System.currentTimeMillis()); //simulate session last saved recently
commitAndCheckSaveState(cache, store, session, false, true, false, true, 0, 0);
//call release: not dirty, release sets metadirty true (recalc expiry) but not within saveperiod so skip write
cache.release("1234", session);
@ -515,7 +515,7 @@ public abstract class AbstractSessionCacheTest
assertFalse(cache.contains("1234"));
//test remove of session in both store and cache
session = cache.newSession(null, "1234",now - 20, TimeUnit.MINUTES.toMillis(10));//saveOnCreate ensures write to store
session = cache.newSession(null, "1234", now - 20, TimeUnit.MINUTES.toMillis(10)); //saveOnCreate ensures write to store
cache.add("1234", session);
assertTrue(store.exists("1234"));
assertTrue(cache.contains("1234"));
@ -638,7 +638,7 @@ public abstract class AbstractSessionCacheTest
AbstractSessionCacheFactory cacheFactory = newSessionCacheFactory(SessionCache.NEVER_EVICT, false, false, false, false);
SessionCache cache = cacheFactory.getSessionCache(context.getSessionHandler());
TestSessionDataStore store = new TestSessionDataStore(true);//fake passivation
TestSessionDataStore store = new TestSessionDataStore(true); //fake passivation
cache.setSessionDataStore(store);
context.getSessionHandler().setSessionCache(cache);
TestHttpSessionListener sessionListener = new TestHttpSessionListener();

View File

@ -271,7 +271,7 @@ public class DefaultSessionCacheTest extends AbstractSessionCacheTest
cacheFactory.setEvictionPolicy(SessionCache.NEVER_EVICT);
DefaultSessionCache cache = (DefaultSessionCache)cacheFactory.getSessionCache(context.getSessionHandler());
TestSessionDataStore store = new TestSessionDataStore(true);//fake passivation
TestSessionDataStore store = new TestSessionDataStore(true); //fake passivation
cache.setSessionDataStore(store);
context.getSessionHandler().setSessionCache(cache);
@ -487,11 +487,11 @@ public class DefaultSessionCacheTest extends AbstractSessionCacheTest
//test EVICT_ON_SESSION_EXIT with requests still active.
//this should not affect the session because it this is an idle test only
SessionData data2 = store.newSessionData("567", now, now - TimeUnit.SECONDS.toMillis(30), now - TimeUnit.SECONDS.toMillis(40), TimeUnit.MINUTES.toMillis(10));
data2.setExpiry(now + TimeUnit.DAYS.toMillis(1));//not expired
data2.setExpiry(now + TimeUnit.DAYS.toMillis(1)); //not expired
Session session2 = cache.newSession(data2);
cache.add("567", session2);//ensure session is in cache
cache.add("567", session2); //ensure session is in cache
cache.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
session2.access(System.currentTimeMillis());//simulate 1 request in session
session2.access(System.currentTimeMillis()); //simulate 1 request in session
assertTrue(cache.contains("567"));
cache.checkInactiveSession(session2);
assertTrue(cache.contains("567")); //not evicted

View File

@ -93,8 +93,8 @@ public class NullSessionCacheTest extends AbstractSessionCacheTest
SessionData data = store.newSessionData("1234", now - 20, now - 10, now - 20, TimeUnit.MINUTES.toMillis(10));
data.setExpiry(now + TimeUnit.DAYS.toMillis(1));
Session session = cache.newSession(null, data); //mimic a request making a session
cache.add("1234", session);
assertFalse(cache.contains("1234"));//null cache doesn't actually retain the session
cache.add("1234", session);
assertFalse(cache.contains("1234")); //null cache doesn't actually retain the session
//mimic releasing the session after the request is finished
cache.release("1234", session);