From commits-return-6949-archive-asf-public=cust-asf.ponee.io@juneau.apache.org Tue Oct 13 19:11:00 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 9B6EB18060E for ; Tue, 13 Oct 2020 21:11:00 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id D9475427A4 for ; Tue, 13 Oct 2020 19:10:59 +0000 (UTC) Received: (qmail 58891 invoked by uid 500); 13 Oct 2020 19:10:59 -0000 Mailing-List: contact commits-help@juneau.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.apache.org Delivered-To: mailing list commits@juneau.apache.org Received: (qmail 58878 invoked by uid 99); 13 Oct 2020 19:10:59 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2020 19:10:59 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 3394081A7C; Tue, 13 Oct 2020 19:10:59 +0000 (UTC) Date: Tue, 13 Oct 2020 19:10:58 +0000 To: "commits@juneau.apache.org" Subject: [juneau] branch master updated: Remove deprecated code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <160261625896.20109.3063406665736185882@gitbox.apache.org> From: jamesbognar@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: juneau X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7d8169e30dd9f4f43c7b5cc89cd7a6d253c2bd8a X-Git-Newrev: 7132ee6e58d5f7e37a995718e6ed6b6d12a14bb8 X-Git-Rev: 7132ee6e58d5f7e37a995718e6ed6b6d12a14bb8 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git The following commit(s) were added to refs/heads/master by this push: new 7132ee6 Remove deprecated code. 7132ee6 is described below commit 7132ee6e58d5f7e37a995718e6ed6b6d12a14bb8 Author: JamesBognar AuthorDate: Tue Oct 13 15:10:54 2020 -0400 Remove deprecated code. --- .../org/apache/juneau/rest/RequestProperties.java | 52 ------------- .../org/apache/juneau/rest/RestMethodContext.java | 18 +---- .../juneau/rest/RestMethodContextBuilder.java | 13 ---- .../org/apache/juneau/rest/RestParamDefaults.java | 16 +--- .../java/org/apache/juneau/rest/RestRequest.java | 86 +--------------------- .../java/org/apache/juneau/rest/RestResponse.java | 72 +----------------- 6 files changed, 7 insertions(+), 250 deletions(-) diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java deleted file mode 100644 index 776ef67..0000000 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java +++ /dev/null @@ -1,52 +0,0 @@ -// *************************************************************************************************************************** -// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * -// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * -// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * -// * with the License. You may obtain a copy of the License at * -// * * -// * http://www.apache.org/licenses/LICENSE-2.0 * -// * * -// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * -// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * -// * specific language governing permissions and limitations under the License. * -// *************************************************************************************************************************** -package org.apache.juneau.rest; - -import org.apache.juneau.svl.*; - -/** - * Encapsulates request-level properties. - * - *
- * Deprecated - Use {@link RequestAttributes} - *
- * - *

- * These are properties specified for a single HTTP request that extends the properties defined on {@link RestMethodProperties} - * and are accessible and modifiable through the following: - *

    - *
  • {@link RestRequest#getProperties()} - *
  • {@link RestRequest#prop(String, Object)} - *
  • {@link RestResponse#getProperties()} - *
  • {@link RestResponse#prop(String, Object)} - *
- * - *
    - *
- */ -@SuppressWarnings("serial") -@Deprecated -public class RequestProperties extends ResolvingOMap { - - /** - * Constructor - * - * @param varResolver The request variable resolver session. - * @param inner The inner properties defined on the resource context. - */ - public RequestProperties(VarResolverSession varResolver, RestMethodProperties inner) { - super(varResolver); - inner(inner); - } -} diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodContext.java index 0220546..da7881e 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodContext.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodContext.java @@ -597,8 +597,6 @@ public class RestMethodContext extends BeanContext implements Comparable 0 || m.flags().length > 0) { - properties = new RestMethodProperties(properties); - for (Property p1 : m.properties()) - properties.put(p1.name(), p1.value()); - for (String p1 : m.flags()) - properties.put(p1, true); - } - } catch (RestServletException e) { throw e; } catch (Exception e) { diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java index a57ac52..db1b7d9 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java @@ -100,8 +100,7 @@ class RestParamDefaults { RequestBodyObject.class, ConfigObject.class, UriContextObject.class, - UriResolverObject.class, - RestRequestPropertiesObject.class + UriResolverObject.class }; for (Class c : r) { @@ -556,19 +555,6 @@ class RestParamDefaults { } } - @Deprecated - static final class RestRequestPropertiesObject extends RestMethodParam { - - protected RestRequestPropertiesObject() { - super(OTHER, RequestProperties.class); - } - - @Override /* RestMethodParam */ - public RequestProperties resolve(RestRequest req, RestResponse res) throws Exception { - return req.getProperties(); - } - } - //------------------------------------------------------------------------------------------------------------------- // Other retrievers //------------------------------------------------------------------------------------------------------------------- diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java index e0e94e2..0e34a47 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java @@ -100,8 +100,6 @@ public final class RestRequest extends HttpServletRequestWrapper { private final String method; private RequestBody body; private Method javaMethod; - @SuppressWarnings("deprecation") - private RequestProperties properties; private BeanSession beanSession; private VarResolverSession varSession; private final RequestQuery queryParams; @@ -193,10 +191,9 @@ public final class RestRequest extends HttpServletRequestWrapper { /* * Called from RestServlet after a match has been made but before the guard or method invocation. */ - final void init(RestMethodContext rjm, @SuppressWarnings("deprecation") RequestProperties properties) throws IOException { + final void init(RestMethodContext rjm) throws IOException { this.restJavaMethod = rjm; this.javaMethod = rjm.method; - this.properties = properties; this.beanSession = rjm.createSession(); this.partParserSession = rjm.partParser.createPartSession(getParserSessionArgs()); this.partSerializerSession = rjm.partSerializer.createPartSession(getSerializerSessionArgs()); @@ -219,14 +216,6 @@ public final class RestRequest extends HttpServletRequestWrapper { if (isDebug()) { inner = CachingHttpServletRequest.wrap(inner); } - - String stylesheet = getQuery().getString("stylesheet"); - if (stylesheet != null) - getSession().setAttribute(HTMLDOC_stylesheet, stylesheet.replace(' ', '$')); // Prevent SVL insertion. - stylesheet = (String)getSession().getAttribute("stylesheet"); - if (stylesheet != null) - properties.put(HTMLDOC_stylesheet, new String[]{stylesheet}); - } RestRequest setResponse(RestResponse res) { @@ -245,77 +234,6 @@ public final class RestRequest extends HttpServletRequestWrapper { } //----------------------------------------------------------------------------------------------------------------- - // Properties - //----------------------------------------------------------------------------------------------------------------- - - /** - * Retrieve the properties active for this request. - * - *
- * Deprecated - Use {@link #getAttributes()} - *
- * - *

- * This contains all resource and method level properties from the following: - *

    - *
  • {@link Rest#properties()} - *
  • {@link RestMethod#properties()} - *
  • {@link RestContextBuilder#set(String, Object)} - *
- * - *

- * The returned object is modifiable and allows you to override session-level properties before - * they get passed to the serializers. - *
However, properties are open-ended, and can be used for any purpose. - * - *

Example:
- *

- * @RestMethod( - * properties={ - * @Property(name=SERIALIZER_sortMaps, value="false") - * } - * ) - * public Map doGet(RestRequest req, @Query("sortMaps") Boolean sortMaps) { - * - * // Override value if specified through query parameter. - * if (sortMaps != null) - * req.getProperties().put(SERIALIZER_sortMaps, sortMaps); - * - * return getMyMap(); - * } - *

- * - *
    - *
  • {@link #prop(String, Object)} - *
- * - * @return The properties active for this request. - */ - @Deprecated - public RequestProperties getProperties() { - return this.properties; - } - - /** - * Shortcut for calling getProperties().append(name, value); fluently. - * - *
- * Deprecated - {@link RequestAttributes#put(String, Object)} or {@link #setAttribute(String, Object)} - *
- * - * @param name The property name. - * @param value The property value. - * @return This object (for method chaining). - */ - @Deprecated - public RestRequest prop(String name, Object value) { - this.properties.append(name, value); - return this; - } - - - //----------------------------------------------------------------------------------------------------------------- // Headers //----------------------------------------------------------------------------------------------------------------- @@ -1706,7 +1624,6 @@ public final class RestRequest extends HttpServletRequestWrapper { if (serializerSessionArgs == null) serializerSessionArgs = SerializerSessionArgs .create() - .properties(getProperties()) .javaMethod(getJavaMethod()) .locale(getLocale()) .timeZone(getHeaders().getTimeZone()) @@ -1727,7 +1644,6 @@ public final class RestRequest extends HttpServletRequestWrapper { parserSessionArgs = ParserSessionArgs .create() - .properties(getProperties()) .javaMethod(getJavaMethod()) .locale(getLocale()) .timeZone(getHeaders().getTimeZone()) diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java index bed181d..58dd30b 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java @@ -28,7 +28,6 @@ import org.apache.juneau.encoders.*; import org.apache.juneau.http.*; import org.apache.juneau.httppart.*; import org.apache.juneau.httppart.bean.*; -import org.apache.juneau.rest.annotation.*; import org.apache.juneau.http.exception.*; import org.apache.juneau.http.header.*; import org.apache.juneau.rest.util.*; @@ -64,8 +63,6 @@ public final class RestResponse extends HttpServletResponseWrapper { private RestMethodContext restJavaMethod; private Object output; // The POJO being sent to the output. private boolean isNullOutput; // The output is null (as opposed to not being set at all) - @SuppressWarnings("deprecation") - private RequestProperties properties; // Response properties private ServletOutputStream sos; private FinishableServletOutputStream os; private FinishablePrintWriter w; @@ -101,9 +98,8 @@ public final class RestResponse extends HttpServletResponseWrapper { /* * Called from RestServlet after a match has been made but before the guard or method invocation. */ - final void init(RestMethodContext rjm, @SuppressWarnings("deprecation") RequestProperties properties) throws NotAcceptable, IOException { + final void init(RestMethodContext rjm) throws NotAcceptable, IOException { this.restJavaMethod = rjm; - this.properties = properties; if (request.isDebug()) setDebug(); @@ -204,72 +200,6 @@ public final class RestResponse extends HttpServletResponseWrapper { } /** - * Retrieve the properties active for this request. - * - *
- * Deprecated - Use {@link RestResponse#getAttributes()} - *
- * - *

- * This contains all resource and method level properties from the following: - *

    - *
  • {@link Rest#properties()} - *
  • {@link RestMethod#properties()} - *
  • {@link RestContextBuilder#set(String, Object)} - *
- * - *

- * The returned object is modifiable and allows you to override session-level properties before - * they get passed to the serializers. - *
However, properties are open-ended, and can be used for any purpose. - * - *

Example:
- *

- * @RestMethod( - * properties={ - * @Property(name=SERIALIZER_sortMaps, value="false") - * } - * ) - * public Map doGet(RestResponse res, @Query("sortMaps") Boolean sortMaps) { - * - * // Override value if specified through query parameter. - * if (sortMaps != null) - * res.getProperties().put(SERIALIZER_sortMaps, sortMaps); - * - * return getMyMap(); - * } - *

- * - *
    - *
  • {@link #prop(String, Object)} - *
- * - * @return The properties active for this request. - */ - @Deprecated - public RequestProperties getProperties() { - return properties; - } - - /** - * Shortcut for calling getProperties().append(name, value); fluently. - * - *
- * Deprecated - Use {@link #attr(String,Object)} - *
- * - * @param name The property name. - * @param value The property value. - * @return This object (for method chaining). - */ - @Deprecated - public RestResponse prop(String name, Object value) { - this.properties.append(name, value); - return this; - } - - /** * Shortcut for calling getRequest().getAttributes(). * * @return The request attributes object.