juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [juneau] branch master updated: Remove deprecated code.
Date Tue, 13 Oct 2020 21:25:52 GMT
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 a914e50  Remove deprecated code.
a914e50 is described below

commit a914e50588127c3aefe56027a8ea3f2b4451fcba
Author: JamesBognar <james.bognar@salesforce.com>
AuthorDate: Tue Oct 13 17:25:48 2020 -0400

    Remove deprecated code.
---
 .../java/org/apache/juneau/rest/RestContext.java   | 94 ----------------------
 .../org/apache/juneau/rest/RestContextBuilder.java | 31 -------
 .../java/org/apache/juneau/rest/RestRequest.java   | 34 --------
 .../juneau/rest/annotation/RestConfigApply.java    | 25 ------
 .../rest/annotation/RestMethodConfigApply.java     |  8 --
 5 files changed, 192 deletions(-)

diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 8009a84..7fc6749 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -29,7 +29,6 @@ import java.nio.charset.*;
 import java.time.*;
 import java.util.*;
 import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
 import java.util.stream.*;
 
 import javax.activation.*;
@@ -386,16 +385,6 @@ public class RestContext extends BeanContext {
 	public static final String REST_allowedMethodParams = PREFIX + ".allowedMethodParams.s";
 
 	/**
-	 * Configuration property:  Allow header URL parameters.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #REST_allowedHeaderParams}
-	 * </div>
-	 */
-	@Deprecated
-	public static final String REST_allowHeaderParams = PREFIX + ".allowHeaderParams.b";
-
-	/**
 	 * Configuration property:  REST call logger.
 	 *
 	 * <h5 class='section'>Property:</h5>
@@ -1082,36 +1071,6 @@ public class RestContext extends BeanContext {
 	public static final String REST_defaultCharset = PREFIX + ".defaultCharset.s";
 
 	/**
-	 * Configuration property:  Default request attributes.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #REST_reqAttrs}
-	 * </div>
-	 */
-	@Deprecated
-	public static final String REST_attrs = PREFIX + ".reqAttrs.smo";
-
-	/**
-	 * Configuration property:  Default request headers.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #REST_reqHeaders}
-	 * </div>
-	 */
-	@Deprecated
-	public static final String REST_defaultRequestHeaders = PREFIX + ".reqHeaders.smo";
-
-	/**
-	 * Configuration property:  Default response headers.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #REST_resHeaders}
-	 * </div>
-	 */
-	@Deprecated
-	public static final String REST_defaultResponseHeaders = PREFIX + ".resHeaders.omo";
-
-	/**
 	 * Configuration property:  Compression encoders.
 	 *
 	 * <h5 class='section'>Property:</h5>
@@ -1375,16 +1334,6 @@ public class RestContext extends BeanContext {
 	public static final String REST_infoProvider = PREFIX + ".infoProvider.o";
 
 	/**
-	 * Configuration property:  REST logger.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #REST_callLogger}
-	 * </div>
-	 */
-	@Deprecated
-	public static final String REST_logger = PREFIX + ".logger.o";
-
-	/**
 	 * Configuration property:  The maximum allowed input size (in bytes) on HTTP requests.
 	 *
 	 * <h5 class='section'>Property:</h5>
@@ -3213,16 +3162,6 @@ public class RestContext extends BeanContext {
 	public static final String REST_useClasspathResourceCaching = PREFIX + ".useClasspathResourceCaching.b";
 
 	/**
-	 * Configuration property:  Use stack trace hashes.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link Logging#useStackTraceHashing}
-	 * </div>
-	 */
-	@Deprecated
-	public static final String REST_useStackTraceHashes = PREFIX + ".useStackTraceHashes.b";
-
-	/**
 	 * Configuration property:  Resource URI authority path.
 	 *
 	 * <h5 class='section'>Property:</h5>
@@ -3555,8 +3494,6 @@ public class RestContext extends BeanContext {
 		renderResponseStackTraces,
 		useClasspathResourceCaching;
 	private final Enablement debug;
-	@Deprecated private final boolean
-		useStackTraceHashes;
 	private final String
 		clientVersionHeader,
 		uriAuthority,
@@ -3627,7 +3564,6 @@ public class RestContext extends BeanContext {
 	private final Map<String,StaticFile> staticFilesCache = new ConcurrentHashMap<>();
 
 	private final ResourceManager staticResourceManager;
-	@Deprecated private final ConcurrentHashMap<Integer,AtomicInteger> stackTraceHashes
= new ConcurrentHashMap<>();
 
 	private final ThreadLocal<RestCall> call = new ThreadLocal<>();
 
@@ -3721,7 +3657,6 @@ public class RestContext extends BeanContext {
 			allowedMethodParams = newUnmodifiableSortedCaseInsensitiveSet(getStringPropertyWithNone(REST_allowedMethodParams,
"HEAD,OPTIONS"));
 			allowedMethodHeaders = newUnmodifiableSortedCaseInsensitiveSet(getStringPropertyWithNone(REST_allowedMethodHeaders,
""));
 			renderResponseStackTraces = getBooleanProperty(REST_renderResponseStackTraces, false);
-			useStackTraceHashes = getBooleanProperty(REST_useStackTraceHashes, true);
 			clientVersionHeader = getStringProperty(REST_clientVersionHeader, "X-Client-Version");
 
 			ReflectionMap.Builder<Enablement> deb = ReflectionMap.create(Enablement.class);
@@ -4548,37 +4483,8 @@ public class RestContext extends BeanContext {
 	}
 
 	/**
-	 * Returns the number of times this exception was thrown based on a hash of its stacktrace.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Not used by new logging API.
-	 * </div>
-	 *
-	 * <ul class='seealso'>
-	 * 	<li class='jf'>{@link RestContext#REST_useStackTraceHashes}
-	 * </ul>
-	 *
-	 * @param e The exception to check.
-	 * @return
-	 * 	The number of times this exception was thrown, or <c>0</c> if {@link #REST_useStackTraceHashes}
-	 * 	setting is not enabled.
-	 */
-	@Deprecated
-	public int getStackTraceOccurrence(Throwable e) {
-		if (! useStackTraceHashes)
-			return 0;
-		int h = e.hashCode();
-		stackTraceHashes.putIfAbsent(h, new AtomicInteger());
-		return stackTraceHashes.get(h).incrementAndGet();
-	}
-
-	/**
 	 * Returns whether it's safe to render stack traces in HTTP responses.
 	 *
-	 * <ul class='seealso'>
-	 * 	<li class='jf'>{@link RestContext#REST_useStackTraceHashes}
-	 * </ul>
-	 *
 	 * @return <jk>true</jk> if setting is enabled.
 	 */
 	public boolean isRenderResponseStackTraces() {
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
index cf6d399..c007a9a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
@@ -530,37 +530,6 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 	}
 
 	/**
-	 * <i><l>RestContext</l> configuration property:&emsp;</i> 
Allow header URL parameters.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #allowedHeaderParams(String)}
-	 * </div>
-	 *
-	 * <p>
-	 * When enabled, headers such as <js>"Accept"</js> and <js>"Content-Type"</js>
to be passed in as URL query
-	 * parameters.
-	 * <br>
-	 * For example:
-	 * <p class='bcode w800'>
-	 *  ?Accept=text/json&amp;Content-Type=text/json
-	 * </p>
-	 *
-	 * <ul class='seealso'>
-	 * 	<li class='jf'>{@link RestContext#REST_allowHeaderParams}
-	 * </ul>
-	 *
-	 * @param value
-	 * 	The new value for this setting.
-	 * 	<br>The default is <jk>true</jk>.
-	 * @return This object (for method chaining).
-	 */
-	@Deprecated
-	@FluentSetter
-	public RestContextBuilder allowHeaderParams(boolean value) {
-		return set(REST_allowedHeaderParams, value ? "*" : null);
-	}
-
-	/**
 	 * <i><l>RestContext</l> configuration property:&emsp;</i> 
REST call logger.
 	 *
 	 * <p>
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 0e34a47..fb3c4e2 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
@@ -1652,40 +1652,6 @@ public final class RestRequest extends HttpServletRequestWrapper {
 	}
 
 	/**
-	 * Logger.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use standard logging APIs
-	 * </div>
-	 *
-	 * <p>
-	 * Shortcut for calling <c>getContext().getLogger()</c>.
-	 *
-	 * <h5 class='section'>Example:</h5>
-	 * <p class='bcode w800'>
-	 * 	<ja>@RestMethod</ja>(...)
-	 * 	<jk>public void</jk> doGet(RestRequest req) {
-	 *
-	 * 		req.getLogger().logObjects(<jsf>FINE</jsf>, <js>"Request query parameters
= {0}"</js>, req.getQuery());
-	 * 	}
-	 * </p>
-	 *
-	 * <ul class='seealso'>
-	 * 	<li class='jf'>{@link org.apache.juneau.rest.RestContext#REST_logger}
-	 * 	<li class='jm'>{@link org.apache.juneau.rest.RestServlet#log(Level, String, Object...)}
-	 * 	<li class='link'>{@doc RestLoggingAndDebugging}
-	 * </ul>
-	 *
-	 * @return
-	 * 	The logger associated with the resource context.
-	 * 	<br>Never <jk>null</jk>.
-	 */
-	@Deprecated
-	public RestCallLogger getLogger() {
-		return null;
-	}
-
-	/**
 	 * Returns the logging configuration defined on the Java method that this request is executing
against.
 	 *
 	 * @return The logging configuration defined on the Java method that this request is executing
against.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestConfigApply.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestConfigApply.java
index b1eea4f..8befd29 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestConfigApply.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestConfigApply.java
@@ -49,7 +49,6 @@ public class RestConfigApply extends ConfigApply<Rest> {
 		super(c, r);
 	}
 
-	@SuppressWarnings("deprecation")
 	@Override
 	public void apply(AnnotationInfo<Rest> ai, PropertyStoreBuilder psb) {
 		Rest a = ai.getAnnotation();
@@ -86,14 +85,6 @@ public class RestConfigApply extends ConfigApply<Rest> {
 		if (a.consumes().length > 0)
 			psb.set(REST_consumes, strings(a.consumes()));
 
-		for (String ra : strings(a.attrs())) {
-			String[] ra2 = RestUtils.parseKeyValuePair(ra);
-			if (ra2 == null)
-				throw new BasicRuntimeException("Invalid default request attribute specified: ''{0}''.
 Must be in the format: ''Name: value''", ra);
-			if (isNotEmpty(ra2[1]))
-				psb.putTo(REST_attrs, ra2[0], ra2[1]);
-		}
-
 		for (String ra : strings(a.reqAttrs())) {
 			String[] ra2 = RestUtils.parseKeyValuePair(ra);
 			if (ra2 == null)
@@ -102,14 +93,6 @@ public class RestConfigApply extends ConfigApply<Rest> {
 				psb.putTo(REST_reqAttrs, ra2[0], ra2[1]);
 		}
 
-		for (String header : strings(a.defaultRequestHeaders())) {
-			String[] h = RestUtils.parseHeader(header);
-			if (h == null)
-				throw new BasicRuntimeException("Invalid default request header specified: ''{0}''. 
Must be in the format: ''Header-Name: header-value''", header);
-			if (isNotEmpty(h[1]))
-				psb.putTo(REST_defaultRequestHeaders, h[0], h[1]);
-		}
-
 		for (String header : strings(a.reqHeaders())) {
 			String[] h = RestUtils.parseHeader(header);
 			if (h == null)
@@ -131,14 +114,6 @@ public class RestConfigApply extends ConfigApply<Rest> {
 
 		}
 
-		for (String header : strings(a.defaultResponseHeaders())) {
-			String[] h = parseHeader(header);
-			if (h == null)
-				throw new BasicRuntimeException("Invalid default response header specified: ''{0}''.
 Must be in the format: ''Header-Name: header-value''", header);
-			if (isNotEmpty(h[1]))
-				psb.putTo(REST_defaultResponseHeaders, h[0], h[1]);
-		}
-
 		for (String header : strings(a.resHeaders())) {
 			String[] h = parseHeader(header);
 			if (h == null)
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethodConfigApply.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethodConfigApply.java
index 7394585..3e9320e 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethodConfigApply.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethodConfigApply.java
@@ -78,14 +78,6 @@ public class RestMethodConfigApply extends ConfigApply<RestMethod>
{
 		if (a.consumes().length > 0)
 			psb.set(REST_consumes, strings(a.consumes()));
 
-		for (String header : strings(a.defaultRequestHeaders())) {
-			String[] h = RestUtils.parseHeader(header);
-			if (h == null)
-				throw new ConfigException("Invalid default request header specified on method ''{0}'':
''{1}''.  Must be in the format: ''Header-Name: header-value''", sig, header);
-			if (isNotEmpty(h[1]))
-				psb.putTo(REST_defaultRequestHeaders, h[0], h[1]);
-		}
-
 		for (String header : strings(a.reqHeaders())) {
 			String[] h = RestUtils.parseHeader(header);
 			if (h == null)


Mime
View raw message