You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/01/15 10:04:58 UTC

[tomcat] branch master updated: Delete some deprecated code planned for removal in Tomcat 10

This is an automated email from the ASF dual-hosted git repository.

remm 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 a50060f  Delete some deprecated code planned for removal in Tomcat 10
a50060f is described below

commit a50060fb773e8d3b9ce63c1e17fe91d4f131bbf5
Author: remm <re...@apache.org>
AuthorDate: Wed Jan 15 11:04:36 2020 +0100

    Delete some deprecated code planned for removal in Tomcat 10
    
    No warning when using the default configuration source, the
    implementation looks decent enough for embedded and is what users
    usually expect. It is also a bit annoying to i18n and log too early.
---
 java/org/apache/coyote/AbstractProtocol.java       | 23 -------------
 .../apache/tomcat/util/file/ConfigFileLoader.java  | 39 ++++++----------------
 2 files changed, 11 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java
index 7a04834..92ff009 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -312,29 +312,6 @@ public abstract class AbstractProtocol<S> implements ProtocolHandler,
         return endpoint.getConnectionCount();
     }
 
-    /**
-     * NO-OP.
-     *
-     * @param threadCount Unused
-     *
-     * @deprecated Will be removed in Tomcat 10.
-     */
-    @Deprecated
-    public void setAcceptorThreadCount(int threadCount) {
-    }
-
-    /**
-     * Always returns 1.
-     *
-     * @return Always 1.
-     *
-     * @deprecated Will be removed in Tomcat 10.
-     */
-    @Deprecated
-    public int getAcceptorThreadCount() {
-      return 1;
-    }
-
     public void setAcceptorThreadPriority(int threadPriority) {
         endpoint.setAcceptorThreadPriority(threadPriority);
     }
diff --git a/java/org/apache/tomcat/util/file/ConfigFileLoader.java b/java/org/apache/tomcat/util/file/ConfigFileLoader.java
index ce0f5ee..e6f4f21 100644
--- a/java/org/apache/tomcat/util/file/ConfigFileLoader.java
+++ b/java/org/apache/tomcat/util/file/ConfigFileLoader.java
@@ -17,9 +17,7 @@
  */
 package org.apache.tomcat.util.file;
 
-import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 
 /**
  * This class is used to obtain {@link InputStream}s for configuration files
@@ -30,14 +28,23 @@ public class ConfigFileLoader {
 
     private static ConfigurationSource source;
 
+    /**
+     * Get the configured configuration source. If none has been configured,
+     * a default source based on the calling directory will be used.
+     * @return the configuration source in use
+     */
     public static final ConfigurationSource getSource() {
         if (ConfigFileLoader.source == null) {
-            // TODO: Add logging in Tomcat 10 when the default is silently used, or remove the default
             return ConfigurationSource.DEFAULT;
         }
         return source;
     }
 
+    /**
+     * Set the configuration source used by Tomcat to locate various
+     * configuration resources.
+     * @param source The source
+     */
     public static final void setSource(ConfigurationSource source) {
         if (ConfigFileLoader.source == null) {
             ConfigFileLoader.source = source;
@@ -45,32 +52,8 @@ public class ConfigFileLoader {
     }
 
     private ConfigFileLoader() {
-        // Utility class. Hide the default constructor.
+        // Hide the constructor
     }
 
 
-    /**
-     * Load the resource from the specified location.
-     *
-     * @param location The location for the resource of interest. The location
-     *                 may be a URL or a file path. Relative paths will be
-     *                 resolved against CATALINA_BASE.
-     *
-     * @return The InputStream for the given resource. The caller is responsible
-     *         for closing this stream when it is no longer used.
-     *
-     * @throws IOException If an InputStream cannot be created using the
-     *                     provided location
-     */
-    @Deprecated
-    public static InputStream getInputStream(String location) throws IOException {
-        return getSource().getResource(location).getInputStream();
-    }
-
-
-    @Deprecated
-    public static URI getURI(String location) {
-        return getSource().getURI(location);
-    }
-
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org