tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1538839 - /tomcat/trunk/java/org/apache/catalina/webresources/
Date Tue, 05 Nov 2013 00:09:16 GMT
Author: markt
Date: Tue Nov  5 00:09:16 2013
New Revision: 1538839

URL: http://svn.apache.org/r1538839
Log:
Use UCDetector to reduce visibility generally in the webresources
package. It can always be increased on a case by case basis if
necessary.

Modified:
    tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResource.java
    tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
    tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
    tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java
    tomcat/trunk/java/org/apache/catalina/webresources/Cache.java
    tomcat/trunk/java/org/apache/catalina/webresources/FileResource.java
    tomcat/trunk/java/org/apache/catalina/webresources/FileResourceSet.java
    tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java
    tomcat/trunk/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java

Modified: tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResource.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResource.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResource.java Tue Nov
 5 00:09:16 2013
@@ -63,15 +63,15 @@ public abstract class AbstractArchiveRes
         }
     }
 
-    public String getBase() {
+    protected final String getBase() {
         return base;
     }
 
-    public String getBaseUrl() {
+    protected final String getBaseUrl() {
         return baseUrl;
     }
 
-    public JarEntry getResource() {
+    protected final JarEntry getResource() {
         return resource;
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java Tue
Nov  5 00:09:16 2013
@@ -36,19 +36,19 @@ public abstract class AbstractArchiveRes
     private Manifest manifest;
 
 
-    protected void setManifest(Manifest manifest) {
+    protected final void setManifest(Manifest manifest) {
         this.manifest = manifest;
     }
 
-    public String getBaseUrl() {
+    protected final String getBaseUrl() {
         return baseUrl;
     }
 
-    public void setBaseUrl(String baseUrl) {
+    protected final void setBaseUrl(String baseUrl) {
         this.baseUrl = baseUrl;
     }
 
-    public HashMap<String,JarEntry> getJarFileEntries() {
+    protected final HashMap<String,JarEntry> getJarFileEntries() {
         return jarFileEntries;
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java Tue Nov
 5 00:09:16 2013
@@ -26,15 +26,19 @@ public abstract class AbstractFileResour
 
     protected static final String[] EMPTY_STRING_ARRAY = new String[0];
 
-    protected File fileBase;
-    protected String absoluteBase;
-    protected String canonicalBase;
+    private File fileBase;
+    private String absoluteBase;
+    private String canonicalBase;
 
     protected AbstractFileResourceSet(String internalPath) {
         setInternalPath(internalPath);
     }
 
-    protected File file(String name, boolean mustExist) {
+    protected final File getFileBase() {
+        return fileBase;
+    }
+
+    protected final File file(String name, boolean mustExist) {
 
         if (name.equals("/")) {
             name = "";
@@ -96,7 +100,7 @@ public abstract class AbstractFileResour
      *
      * @param path Path to be normalized
      */
-    protected String normalize(String path) {
+    private String normalize(String path) {
         return RequestUtil.normalize(path, File.separatorChar == '/');
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java Tue Nov  5
00:09:16 2013
@@ -48,16 +48,16 @@ public abstract class AbstractResourceSe
         this.root = root;
     }
 
-    public final WebResourceRoot getRoot() {
+    protected final WebResourceRoot getRoot() {
         return root;
     }
 
 
-    public String getInternalPath() {
+    protected final String getInternalPath() {
         return internalPath;
     }
 
-    public void setInternalPath(String internalPath) {
+    protected final void setInternalPath(String internalPath) {
         checkPath(internalPath);
         // Optimise internal processing
         if (internalPath.equals("/")) {
@@ -67,7 +67,7 @@ public abstract class AbstractResourceSe
         }
     }
 
-    public final void setWebAppMount(String webAppMount) {
+    protected final void setWebAppMount(String webAppMount) {
         checkPath(webAppMount);
         // Optimise internal processing
         if (webAppMount.equals("/")) {
@@ -77,15 +77,15 @@ public abstract class AbstractResourceSe
         }
     }
 
-    public final String getWebAppMount() {
+    protected final String getWebAppMount() {
         return webAppMount;
     }
 
-    public final void setBase(String base) {
+    protected final void setBase(String base) {
         this.base = base;
     }
 
-    public final String getBase() {
+    protected final String getBase() {
         return base;
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/webresources/Cache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/Cache.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/Cache.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/Cache.java Tue Nov  5 00:09:16 2013
@@ -48,7 +48,7 @@ public class Cache {
     private long maxSize = 10 * 1024 * 1024;
     private long maxObjectSize = maxSize / 20;
 
-    private ConcurrentMap<String,CachedResource> resourceCache =
+    private final ConcurrentMap<String,CachedResource> resourceCache =
             new ConcurrentHashMap<>();
 
     public Cache(StandardRoot root) {

Modified: tomcat/trunk/java/org/apache/catalina/webresources/FileResource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/FileResource.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/FileResource.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/FileResource.java Tue Nov  5 00:09:16
2013
@@ -214,10 +214,6 @@ public class FileResource extends Abstra
         return null;
     }
 
-    protected File getResourceInternal() {
-        return resource;
-    }
-
     @Override
     protected Log getLog() {
         return log;

Modified: tomcat/trunk/java/org/apache/catalina/webresources/FileResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/FileResourceSet.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/FileResourceSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/FileResourceSet.java Tue Nov  5 00:09:16
2013
@@ -112,8 +112,8 @@ public class FileResourceSet extends Abs
 
         if (webAppMount.startsWith(path)) {
             webAppMount = webAppMount.substring(path.length());
-            if (webAppMount.equals(fileBase.getName())) {
-                return new String[] {fileBase.getName()};
+            if (webAppMount.equals(getFileBase().getName())) {
+                return new String[] {getFileBase().getName()};
             } else {
                 // Virtual directory
                 int i = webAppMount.indexOf('/');
@@ -139,8 +139,8 @@ public class FileResourceSet extends Abs
 
         if (webAppMount.startsWith(path)) {
             webAppMount = webAppMount.substring(path.length());
-            if (webAppMount.equals(fileBase.getName())) {
-                result.add(path + fileBase.getName());
+            if (webAppMount.equals(getFileBase().getName())) {
+                result.add(path + getFileBase().getName());
             } else {
                 // Virtual directory
                 int i = webAppMount.indexOf('/');

Modified: tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java Tue Nov  5 00:09:16
2013
@@ -61,21 +61,21 @@ public class StandardRoot extends Lifecy
 
     private Context context;
     private boolean allowLinking = false;
-    private ArrayList<WebResourceSet> preResources = new ArrayList<>();
+    private final ArrayList<WebResourceSet> preResources = new ArrayList<>();
     private WebResourceSet main;
-    private ArrayList<WebResourceSet> classResources = new ArrayList<>();
-    private ArrayList<WebResourceSet> jarResources = new ArrayList<>();
-    private ArrayList<WebResourceSet> postResources = new ArrayList<>();
+    private final ArrayList<WebResourceSet> classResources = new ArrayList<>();
+    private final ArrayList<WebResourceSet> jarResources = new ArrayList<>();
+    private final ArrayList<WebResourceSet> postResources = new ArrayList<>();
 
-    private Cache cache = new Cache(this);
+    private final Cache cache = new Cache(this);
     private boolean cachingAllowed = true;
 
     private boolean traceLockedFiles = false;
-    private Set<WebResourceTraceWrapper> tracedResources = new HashSet<>();
+    private final Set<WebResourceTraceWrapper> tracedResources = new HashSet<>();
 
     // Constructs to make iteration over all WebResourceSets simpler
-    private ArrayList<WebResourceSet> mainResources = new ArrayList<>();
-    private ArrayList<ArrayList<WebResourceSet>> allResources =
+    private final ArrayList<WebResourceSet> mainResources = new ArrayList<>();
+    private final ArrayList<ArrayList<WebResourceSet>> allResources =
             new ArrayList<>();
     {
         allResources.add(preResources);
@@ -214,7 +214,7 @@ public class StandardRoot extends Lifecy
     }
 
 
-    protected WebResource getResourceInternal(String path,
+    protected final WebResource getResourceInternal(String path,
             boolean useClassLoaderResources) {
         WebResource result = null;
         WebResource virtual = null;
@@ -490,7 +490,7 @@ public class StandardRoot extends Lifecy
     /**
      * For unit testing
      */
-    protected void setMainResources(WebResourceSet main) {
+    protected final void setMainResources(WebResourceSet main) {
         this.main = main;
         mainResources.clear();
         mainResources.add(main);
@@ -674,12 +674,12 @@ public class StandardRoot extends Lifecy
         }
 
 
-        public String getBasePath() {
+        String getBasePath() {
             return basePath;
         }
 
 
-        public String getArchivePath() {
+        String getArchivePath() {
             return archivePath;
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java?rev=1538839&r1=1538838&r2=1538839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java
Tue Nov  5 00:09:16 2013
@@ -57,7 +57,7 @@ public class TomcatURLStreamHandlerFacto
     private final boolean registered;
 
     // List of factories for application defined stream handler factories.
-    private List<URLStreamHandlerFactory> userFactories =
+    private final List<URLStreamHandlerFactory> userFactories =
             new CopyOnWriteArrayList<>();
 
     /**



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


Mime
View raw message