You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/09/11 11:09:01 UTC

DO NOT REPLY [Bug 47820] New: Static utility methods in Tomcat should be instance methods

https://issues.apache.org/bugzilla/show_bug.cgi?id=47820

           Summary: Static utility methods in Tomcat should be instance
                    methods
           Product: Tomcat 7
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Integration
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: david_syer@hotmail.com


--- Comment #0 from Dave Syer <da...@hotmail.com> 2009-09-11 02:09:00 PDT ---
Why are the static addServlet() methods in Tomcat static?  I can see
they don't use any state from the instance, but isn't it cleaner to use
an instance method, so that the API is uniform (everything I want to do
to a tomcat instance goes through the instance)?  It would be more
consistent to follow the pattern of addServlet(String,String,String),
and search for the context by name instead of requiring the instance to
be passed in to a static method.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47820] Static utility methods in Tomcat should be instance methods

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47820

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> 2009-09-15 11:28:39 BST ---
I see where you are coming from but I just couldn't bring myself to change the
static methods to instance methods since they really should be static methods.

What I did was added non-static versions of all the static methods that took a
contextPath rather than a StandardContext. This provides consistency for those
that want consistency and keeps the static methods for those that prefer them.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47820] Static utility methods in Tomcat should be instance methods

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47820

--- Comment #2 from Dave Syer <da...@hotmail.com> 2009-09-15 03:33:02 PDT ---
Thanks.  I'm happy with the non-static methods (and I would have removed the
static ones if I were you, but I'm not).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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