diff --git a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 02135c644c3f..080012f22b88 100644 --- a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -25,7 +25,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Objects; +import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; import java.util.function.Consumer; @@ -714,14 +716,13 @@ default InvocationType getInvocationType() /** *

A wrapper for {@code Request} instances.

*/ - class Wrapper extends Attributes.Wrapper implements Request + class Wrapper implements Request, Attributes { - private final Request request; + private final Request wrapped; public Wrapper(Request wrapped) { - super(wrapped); - this.request = wrapped; + this.wrapped = Objects.requireNonNull(wrapped); } @Override @@ -857,10 +858,44 @@ public Session getSession(boolean create) } @Override + public Object removeAttribute(String name) + { + return getWrapped().removeAttribute(name); + } + + @Override + public Object setAttribute(String name, Object attribute) + { + return getWrapped().setAttribute(name, attribute); + } + + @Override + public Object getAttribute(String name) + { + return getWrapped().getAttribute(name); + } + + @Override + public Set getAttributeNameSet() + { + return getWrapped().getAttributeNameSet(); + } + + @Override + public Map asAttributeMap() + { + return getWrapped().asAttributeMap(); + } + + @Override + public void clearAttributes() + { + getWrapped().clearAttributes(); + } + public Request getWrapped() { - // Identical to (Request)super.getWrapped() except that the cast is costly here. - return request; + return wrapped; } }