Skip to content

Commit 4ebf77a

Browse files
authored
Merge pull request #12770 from jetty/fix/12.0.x/fix-old-jetty-home-references
Issue #12768 - Cleanup references to old Jetty versions
2 parents a57b7db + 07a6f45 commit 4ebf77a

File tree

17 files changed

+38
-41
lines changed

17 files changed

+38
-41
lines changed

jetty-core/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java

+8-14
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,15 @@ private void format(StringBuilder builder, JettyLogger logger, Level level, long
185185

186186
private String renderedLevel(Level level)
187187
{
188-
switch (level)
188+
return switch (level)
189189
{
190-
case ERROR: // New for Jetty 10+
191-
return "ERROR";
192-
case WARN:
193-
return "WARN ";
194-
case INFO:
195-
return "INFO ";
196-
case DEBUG:
197-
return "DEBUG";
198-
case TRACE: // New for Jetty 10+
199-
return "TRACE";
200-
default:
201-
return "UNKNOWN";
202-
}
190+
case ERROR -> "ERROR";
191+
case WARN -> "WARN ";
192+
case INFO -> "INFO ";
193+
case DEBUG -> "DEBUG";
194+
case TRACE -> "TRACE";
195+
default -> "UNKNOWN";
196+
};
203197
}
204198

205199
private void appendCause(StringBuilder builder, Throwable cause, String indent, Set<Throwable> visited)

jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java

-5
Original file line numberDiff line numberDiff line change
@@ -1468,11 +1468,6 @@ public void setProperty(StartEnvironment environment, String key, String value,
14681468
JavaVersion ver = JavaVersion.parse(value);
14691469
properties.setProperty("java.version.platform", Integer.toString(ver.getPlatform()), source);
14701470

1471-
// @deprecated - below will be removed in Jetty 10.x
1472-
properties.setProperty("java.version.major", Integer.toString(ver.getMajor()), "Deprecated");
1473-
properties.setProperty("java.version.minor", Integer.toString(ver.getMinor()), "Deprecated");
1474-
properties.setProperty("java.version.micro", Integer.toString(ver.getMicro()), "Deprecated");
1475-
14761471
// ALPN feature exists
14771472
properties.setProperty("runtime.feature.alpn", Boolean.toString(isMethodAvailable(javax.net.ssl.SSLParameters.class, "getApplicationProtocols", null)), source);
14781473
}

jetty-core/jetty-start/src/test/java/org/eclipse/jetty/start/CommandLineBuilderTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public void testSimpleHomeWithSpace()
4949
{
5050
CommandLineBuilder cmd = new CommandLineBuilder();
5151
cmd.addArg("java");
52-
cmd.addArg("-Djetty.home", "/opt/jetty 10/home");
53-
assertThat(cmd.toCommandLine(), is("java -Djetty.home='/opt/jetty 10/home'"));
52+
cmd.addArg("-Djetty.home", "/opt/jetty 12/home");
53+
assertThat(cmd.toCommandLine(), is("java -Djetty.home='/opt/jetty 12/home'"));
5454
}
5555

5656
@Test

jetty-core/jetty-websocket/jetty-websocket-jetty-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientInitTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
public class WebSocketClientInitTest
2828
{
2929
/**
30-
* This is the new Jetty 9.4 advanced usage mode of WebSocketClient,
30+
* Advanced usage mode of WebSocketClient,
3131
* that allows for more robust HTTP configurations (such as authentication,
3232
* cookies, and proxies)
3333
*

jetty-ee10/jetty-ee10-demos/jetty-ee10-demo-embedded/src/main/java/org/eclipse/jetty/ee10/demos/LikeJettyXml.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@
5757
import org.slf4j.LoggerFactory;
5858

5959
/**
60-
* Starts the Jetty Distribution's demo-base directory using entirely
61-
* embedded jetty techniques.
60+
* Starts a new Jetty Base in the target/embedded/ directory using entirely
61+
* embedded jetty techniques, in ways similar to the various Jetty XML files
62+
* from {@code jetty-home}
6263
*/
6364
public class LikeJettyXml
6465
{

jetty-ee10/jetty-ee10-demos/jetty-ee10-demo-embedded/src/test/java/org/eclipse/jetty/ee10/demos/LikeJettyXmlTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void startServer() throws Exception
4444
Map<String, Integer> ports = ServerUtil.fixDynamicPortConfigurations(server);
4545

4646
// Establish base URI's that use "localhost" to prevent tripping over
47-
// the "REMOTE ACCESS" warnings in demo-base
47+
// the "REMOTE ACCESS" warnings in webapps/ee#-demo-jetty.d/ee#-demo-jetty-override-web.xml
4848
serverPlainUri = URI.create("http://localhost:" + ports.get("plain") + "/");
4949
serverSslUri = URI.create("https://localhost:" + ports.get("secure") + "/");
5050
}

jetty-ee10/jetty-ee10-demos/jetty-ee10-demo-embedded/src/test/java/org/eclipse/jetty/ee10/demos/ManyConnectorsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void startServer() throws Exception
4343
Map<String, Integer> ports = ServerUtil.fixDynamicPortConfigurations(server);
4444

4545
// Establish base URI's that use "localhost" to prevent tripping over
46-
// the "REMOTE ACCESS" warnings in demo-base
46+
// the "REMOTE ACCESS" warnings in webapps/ee#-demo-jetty.d/ee#-demo-jetty-override-web.xml
4747
serverPlainUri = URI.create("http://localhost:" + ports.get("plain") + "/");
4848
serverSslUri = URI.create("https://localhost:" + ports.get("secure") + "/");
4949
}

jetty-ee10/jetty-ee10-demos/jetty-ee10-demo-jetty-webapp/src/main/webapp/remote.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
</div>
1616

1717
<div class="content">
18-
<h1>Welcome to Jetty 11 - REMOTE ACCESS!!</h1>
18+
<h1>Welcome to Jetty 12 (ee10) - REMOTE ACCESS!!</h1>
1919
<p>
2020
This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container.
2121
</p>
2222
<p>
23-
This test context serves several demo filters and servlets that are not safe for deployment on the internet, since (by design) they contain cross domain scripting vulnerabilities and reveal private information. This page is displayed because you have accessed this context from a non local IP address.
23+
This test context serves several demo filters and servlets that are not safe for deployment on the internet,
24+
since (by design) they contain cross domain scripting vulnerabilities and reveal private information.
25+
This page is displayed because you have accessed this context from a non local IP address.
2426
</p>
2527
<p>
26-
You can disable the remote address checking by editing demo-base/webapps/demo-jetty.d/demo-jetty-override-web.xml, uncommenting the declaration of the TestFilter, and changing the "remote" init parameter to "true".
28+
You can disable the remote address checking by editing webapps/ee10-demo-jetty.d/ee10-demo-jetty-override-web.xml,
29+
uncommenting the declaration of the TestFilter, and changing the "remote" init parameter to "true".
2730
</p>
2831
</div>
2932

jetty-ee10/jetty-ee10-demos/jetty-ee10-demo-proxy-webapp/src/test/java/org/eclipse/jetty/ee10/demos/ProxyWebAppTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import static org.hamcrest.Matchers.is;
3535

3636
/**
37-
* Test the configuration found in WEB-INF/web.xml for purposes of the demo-base
37+
* Test the configuration found in WEB-INF/web.xml of ee10-demo-proxy.war
3838
*/
3939
public class ProxyWebAppTest
4040
{

jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-embedded/src/main/java/org/eclipse/jetty/ee9/demos/LikeJettyXml.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
package org.eclipse.jetty.ee9.demos;
1515

1616
/**
17-
* Starts the Jetty Distribution's demo-base directory using entirely
18-
* embedded jetty techniques.
17+
* Starts a new Jetty Base in the target/embedded/ directory using entirely
18+
* embedded jetty techniques, in ways similar to the various Jetty XML files
19+
* from {@code jetty-home}
1920
*/
2021
public class LikeJettyXml
2122
{

jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-embedded/src/test/java/org/eclipse/jetty/ee9/demos/LikeJettyXmlTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void startServer() throws Exception
4545
Map<String, Integer> ports = ServerUtil.fixDynamicPortConfigurations(server);
4646

4747
// Establish base URI's that use "localhost" to prevent tripping over
48-
// the "REMOTE ACCESS" warnings in demo-base
48+
// the "REMOTE ACCESS" warnings in webapps/ee#-demo-jetty.d/ee#-demo-jetty-override-web.xml
4949
serverPlainUri = URI.create("http://localhost:" + ports.get("plain") + "/");
5050
serverSslUri = URI.create("https://localhost:" + ports.get("secure") + "/");
5151
}

jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-embedded/src/test/java/org/eclipse/jetty/ee9/demos/ManyConnectorsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void startServer() throws Exception
4343
Map<String, Integer> ports = ServerUtil.fixDynamicPortConfigurations(server);
4444

4545
// Establish base URI's that use "localhost" to prevent tripping over
46-
// the "REMOTE ACCESS" warnings in demo-base
46+
// the "REMOTE ACCESS" warnings in webapps/ee#-demo-jetty.d/ee#-demo-jetty-override-web.xml
4747
serverPlainUri = URI.create("http://localhost:" + ports.get("plain") + "/");
4848
serverSslUri = URI.create("https://localhost:" + ports.get("secure") + "/");
4949
}

jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-jetty-webapp/src/main/webapp/remote.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
</div>
1616

1717
<div class="content">
18-
<h1>Welcome to Jetty 11 - REMOTE ACCESS!!</h1>
18+
<h1>Welcome to Jetty 12 (ee9) - REMOTE ACCESS!!</h1>
1919
<p>
2020
This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container.
2121
</p>
2222
<p>
23-
This test context serves several demo filters and servlets that are not safe for deployment on the internet, since (by design) they contain cross domain scripting vulnerabilities and reveal private information. This page is displayed because you have accessed this context from a non local IP address.
23+
This test context serves several demo filters and servlets that are not safe for deployment on the internet,
24+
since (by design) they contain cross domain scripting vulnerabilities and reveal private information.
25+
This page is displayed because you have accessed this context from a non local IP address.
2426
</p>
2527
<p>
26-
You can disable the remote address checking by editing demo-base/webapps/demo-jetty.d/demo-jetty-override-web.xml, uncommenting the declaration of the TestFilter, and changing the "remote" init parameter to "true".
28+
You can disable the remote address checking by editing webapps/ee9-demo-jetty.d/ee9-demo-jetty-override-web.xml,
29+
uncommenting the declaration of the TestFilter, and changing the "remote" init parameter to "true".
2730
</p>
2831
</div>
2932

jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-proxy-webapp/src/test/java/org/eclipse/jetty/ee9/demos/ProxyWebAppTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import static org.junit.jupiter.api.Assertions.assertTrue;
3838

3939
/**
40-
* Test the configuration found in WEB-INF/web.xml for purposes of the demo-base
40+
* Test the configuration found in WEB-INF/web.xml of ee9-demo-proxy.war
4141
*/
4242
public class ProxyWebAppTest
4343
{

jetty-ee9/jetty-ee9-osgi/test-jetty-ee9-osgi/src/test/java/org/eclipse/jetty/ee9/osgi/test/TestOSGiUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static void coreJettyDependencies(List<Option> res)
142142
res.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version("1.7.36").startLevel(START_LEVEL_SYSTEM_BUNDLES)); //.versionAsInProject().noStart());
143143

144144
/*
145-
* Jetty 11 uses slf4j 2.0.0 by default, however we want to test with slf4j 1.7.30 for backwards compatibility.
145+
* Jetty 12 uses slf4j 2.0.0 by default, however we want to test with slf4j 1.7.30 for backwards compatibility.
146146
* To do that, we need to use slf4j-simple as the logging implementation. We make a simplelogger.properties
147147
* file available so that jetty logging can be configured
148148
*/

jetty-ee9/jetty-ee9-websocket/jetty-ee9-websocket-jetty-client/src/test/java/org/eclipse/jetty/ee9/websocket/client/WebSocketClientInitTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
public class WebSocketClientInitTest
2828
{
2929
/**
30-
* This is the new Jetty 9.4 advanced usage mode of WebSocketClient,
30+
* Advanced usage mode of WebSocketClient,
3131
* that allows for more robust HTTP configurations (such as authentication,
3232
* cookies, and proxies)
3333
*

jetty-home/src/main/resources/bin/jetty.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ NAME=$(echo $(basename $0) | sed -e 's/^[SK][0-9]*//' -e 's/\.sh$//')
2222
# To get the service to restart correctly on reboot, uncomment below (3 lines):
2323
# ========================
2424
# chkconfig: 3 99 99
25-
# description: Jetty 9 webserver
25+
# description: Eclipse Jetty webserver
2626
# processname: jetty
2727
# ========================
2828

0 commit comments

Comments
 (0)