Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Feb 18, 2021
2 parents 5f93169 + bbcae23 commit 40b42c9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.

This file was deleted.

17 changes: 17 additions & 0 deletions jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -1528,10 +1528,14 @@ public void setProperty(String key, String value, String source)
{
JavaVersion ver = JavaVersion.parse(value);
properties.setProperty("java.version.platform", Integer.toString(ver.getPlatform()), source);

// @deprecated - below will be removed in Jetty 10.x
properties.setProperty("java.version.major", Integer.toString(ver.getMajor()), "Deprecated");
properties.setProperty("java.version.minor", Integer.toString(ver.getMinor()), "Deprecated");
properties.setProperty("java.version.micro", Integer.toString(ver.getMicro()), "Deprecated");

// ALPN feature exists
properties.setProperty("runtime.feature.alpn", Boolean.toString(isMethodAvailable(javax.net.ssl.SSLParameters.class, "getApplicationProtocols", null)), source);
}
catch (Throwable x)
{
Expand All @@ -1548,6 +1552,19 @@ public void setProperty(String key, String value, String source)
}
}

private boolean isMethodAvailable(Class<?> clazz, String methodName, Class<?>[] params)
{
try
{
clazz.getMethod(methodName, params);
return true;
}
catch (NoSuchMethodException e)
{
return false;
}
}

public void setRun(boolean run)
{
this.run = run;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public static void assertConfiguration(BaseHome baseHome, StartArgs args, String
"jetty.base.uri".equals(name) ||
"user.dir".equals(name) ||
prop.source.equals(Props.ORIGIN_SYSPROP) ||
name.startsWith("runtime.feature.") ||
name.startsWith("java."))
{
// strip these out from assertion, to make assertions easier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,11 @@ public void testJettyHomeWithSpaces() throws Exception
{
Path distPath = MavenTestingUtils.getTestResourceDir("dist-home").toPath().toRealPath();
Path homePath = MavenTestingUtils.getTargetTestingPath().resolve("dist home with spaces");
IO.copy(distPath.toFile(), homePath.toFile());
Files.createFile(homePath.resolve("lib/a library.jar"));
if (!Files.exists(homePath))
{
IO.copy(distPath.toFile(), homePath.toFile());
Files.createFile(homePath.resolve("lib/a library.jar"));
}

List<String> cmdLineArgs = new ArrayList<>();
cmdLineArgs.add("user.dir=" + homePath);
Expand Down

0 comments on commit 40b42c9

Please sign in to comment.