You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/01/31 16:17:05 UTC
[tomcat] branch master updated: Remove deprecated code
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 2bf88a1 Remove deprecated code
2bf88a1 is described below
commit 2bf88a14213adc8f31ca022a114d0126435d1704
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 31 16:16:49 2020 +0000
Remove deprecated code
---
java/org/apache/catalina/mapper/Mapper.java | 6 ------
java/org/apache/catalina/mapper/MappingData.java | 6 ------
test/org/apache/catalina/mapper/TestMapper.java | 14 ++++----------
3 files changed, 4 insertions(+), 22 deletions(-)
diff --git a/java/org/apache/catalina/mapper/Mapper.java b/java/org/apache/catalina/mapper/Mapper.java
index 0553f4a..5e57db5 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -732,7 +732,6 @@ public final class Mapper {
* Map the specified URI.
* @throws IOException
*/
- @SuppressWarnings("deprecation") // contextPath
private final void internalMap(CharChunk host, CharChunk uri,
String version, MappingData mappingData) throws IOException {
@@ -823,8 +822,6 @@ public final class Mapper {
return;
}
- mappingData.contextPath.setString(context.name);
-
ContextVersion contextVersion = null;
ContextVersion[] contextVersions = context.versions;
final int versionCount = contextVersions.length;
@@ -1065,7 +1062,6 @@ public final class Mapper {
/**
* Exact mapping.
*/
- @SuppressWarnings("deprecation") // contextPath
private final void internalMapExactWrapper
(MappedWrapper[] wrappers, CharChunk path, MappingData mappingData) {
MappedWrapper wrapper = exactFind(wrappers, path);
@@ -1076,8 +1072,6 @@ public final class Mapper {
// Special handling for Context Root mapped servlet
mappingData.pathInfo.setString("/");
mappingData.wrapperPath.setString("");
- // This seems wrong but it is what the spec says...
- mappingData.contextPath.setString("");
mappingData.matchType = MappingMatch.CONTEXT_ROOT;
} else {
mappingData.wrapperPath.setString(wrapper.name);
diff --git a/java/org/apache/catalina/mapper/MappingData.java b/java/org/apache/catalina/mapper/MappingData.java
index 2d9ec3a..8c5ccec 100644
--- a/java/org/apache/catalina/mapper/MappingData.java
+++ b/java/org/apache/catalina/mapper/MappingData.java
@@ -38,11 +38,6 @@ public class MappingData {
public Wrapper wrapper = null;
public boolean jspWildCard = false;
- /**
- * @deprecated Unused. This will be removed in Tomcat 10.
- */
- @Deprecated
- public final MessageBytes contextPath = MessageBytes.newInstance();
public final MessageBytes requestPath = MessageBytes.newInstance();
public final MessageBytes wrapperPath = MessageBytes.newInstance();
public final MessageBytes pathInfo = MessageBytes.newInstance();
@@ -59,7 +54,6 @@ public class MappingData {
contexts = null;
wrapper = null;
jspWildCard = false;
- contextPath.recycle();
requestPath.recycle();
wrapperPath.recycle();
pathInfo.recycle();
diff --git a/test/org/apache/catalina/mapper/TestMapper.java b/test/org/apache/catalina/mapper/TestMapper.java
index 23a08d1..9ddeb02 100644
--- a/test/org/apache/catalina/mapper/TestMapper.java
+++ b/test/org/apache/catalina/mapper/TestMapper.java
@@ -241,7 +241,6 @@ public class TestMapper extends LoggingBaseTest {
}
@Test
- @SuppressWarnings("deprecation") // contextPath
public void testMap() throws Exception {
MappingData mappingData = new MappingData();
MessageBytes host = MessageBytes.newInstance();
@@ -259,7 +258,6 @@ public class TestMapper extends LoggingBaseTest {
Assert.assertEquals("blah7", mappingData.host.getName());
Assert.assertEquals("context2", mappingData.context.getName());
Assert.assertEquals("wrapper5", mappingData.wrapper.getName());
- Assert.assertEquals("/foo/bar", mappingData.contextPath.toString());
Assert.assertEquals("/blah/bobou", mappingData.wrapperPath.toString());
Assert.assertEquals("/foo", mappingData.pathInfo.toString());
Assert.assertTrue(mappingData.redirectPath.isNull());
@@ -273,7 +271,6 @@ public class TestMapper extends LoggingBaseTest {
Assert.assertEquals("blah7", mappingData.host.getName());
Assert.assertEquals("context3", mappingData.context.getName());
Assert.assertEquals("wrapper7", mappingData.wrapper.getName());
- Assert.assertEquals("/foo/bar/bla", mappingData.contextPath.toString());
Assert.assertEquals("/bobou", mappingData.wrapperPath.toString());
Assert.assertEquals("/foo", mappingData.pathInfo.toString());
Assert.assertTrue(mappingData.redirectPath.isNull());
@@ -287,7 +284,6 @@ public class TestMapper extends LoggingBaseTest {
Assert.assertEquals("blah16", mappingData.host.getName());
Assert.assertEquals("context4", mappingData.context.getName());
Assert.assertEquals("context4-defaultWrapper", mappingData.wrapper.getName());
- Assert.assertEquals("", mappingData.contextPath.toString());
Assert.assertEquals("/foo/bar/bla/bobou/foo", mappingData.wrapperPath.toString());
Assert.assertTrue(mappingData.pathInfo.isNull());
Assert.assertTrue(mappingData.redirectPath.isNull());
@@ -300,7 +296,6 @@ public class TestMapper extends LoggingBaseTest {
Assert.assertEquals("blah7", mappingData.host.getName());
Assert.assertEquals("context3", mappingData.context.getName());
Assert.assertEquals("wrapper7", mappingData.wrapper.getName());
- Assert.assertEquals("/foo/bar/bla", mappingData.contextPath.toString());
Assert.assertEquals("/bobou", mappingData.wrapperPath.toString());
Assert.assertEquals("/foo", mappingData.pathInfo.toString());
Assert.assertTrue(mappingData.redirectPath.isNull());
@@ -493,7 +488,6 @@ public class TestMapper extends LoggingBaseTest {
}
@Test
- @SuppressWarnings("deprecation") // contextPath
public void testContextListConcurrencyBug56653() throws Exception {
final Host host = createHost("localhost");
final Context contextRoot = createContext("ROOT");
@@ -541,24 +535,24 @@ public class TestMapper extends LoggingBaseTest {
uriMB.setChars(uri, 0, uri.length);
mapper.map(hostMB, uriMB, null, mappingData);
- Assert.assertEquals("/foo/bar/bla", mappingData.contextPath.toString());
+ Assert.assertEquals(context3, mappingData.context);
mappingData.recycle();
uriMB.setChars(uri, 0, uri.length);
mapper.map(aliasMB, uriMB, null, mappingData);
- Assert.assertEquals("/foo/bar/bla", mappingData.contextPath.toString());
+ Assert.assertEquals(context3, mappingData.context);
t.start();
while (running.get()) {
mappingData.recycle();
uriMB.setChars(uri, 0, uri.length);
mapper.map(hostMB, uriMB, null, mappingData);
- Assert.assertEquals("/foo/bar/bla", mappingData.contextPath.toString());
+ Assert.assertEquals(context3, mappingData.context);
mappingData.recycle();
uriMB.setChars(uri, 0, uri.length);
mapper.map(aliasMB, uriMB, null, mappingData);
- Assert.assertEquals("/foo/bar/bla", mappingData.contextPath.toString());
+ Assert.assertEquals(context3, mappingData.context);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org