tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: org.apache.catalina.WELCOME_FILES constant (was: svn commit: r1043265)
Date Wed, 08 Dec 2010 11:36:16 GMT
On 08/12/2010 11:05, Konstantin Kolinko wrote:
> 2010/12/8  <markt@apache.org>:
>> Author: markt
>> Date: Wed Dec  8 01:14:43 2010
>> New Revision: 1043265
>>
>> URL: http://svn.apache.org/viewvc?rev=1043265&view=rev
>> Log:
>> Remove unused code.
>> Make spacing consistent.
>>
>> Modified:
>>    tomcat/trunk/java/org/apache/catalina/Globals.java
>>
>> Modified: tomcat/trunk/java/org/apache/catalina/Globals.java
>> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Globals.java?rev=1043265&r1=1043264&r2=1043265&view=diff
>>
> 
>>     /**
>> -     * The servlet context attribute under which we store the class loader
>> -     * used for loading servlets (as an object of type java.lang.ClassLoader).
>> -     */
>> -    public static final String CLASS_LOADER_ATTR =
>> -        "org.apache.catalina.classloader";
>> -
> 
> OK, cannot find any use of this string.
> 
>>     /**
>> -     * The servlet context attribute under which we record the set of
>> -     * welcome files (as an object of type String[]) for this application.
>> -     */
>> -    public static final String WELCOME_FILES_ATTR =
>> -        "org.apache.catalina.WELCOME_FILES";
>> -
> 
> StandardContext.postWelcomeFiles() uses this name to publish welcome
> files "so that the default servlet can find them", but I do not see
> any use of this anywhere else.  That is, the default servlet does not
> use this.
> 
> I see two ways:
> a) remove this feature (remove setting the attribute from that
> StandardContext method),
> b) revert deletion of this constant, and use it in StandardContext.
> 
> I am OK with a)

+1. I suspect that is an old way of handling welcome files. I also
suspect there are lots of things like this in the code base. The more we
can delete, the better.

For those that are interested, I am running an unused code detector [1]
over the Tomcat 7 code base and working my way through the results when
I have a spare 5 mins. (I am doing something similar with FindBugs).

Mark

[1] http://www.ucdetector.org/

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


Mime
View raw message