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 2015/02/23 15:55:44 UTC

[Bug 57625] New: tomcat.util.modeler.Registry.getMBeanServer() always gets the current system time

https://bz.apache.org/bugzilla/show_bug.cgi?id=57625

            Bug ID: 57625
           Summary: tomcat.util.modeler.Registry.getMBeanServer() always
                    gets the current system time
           Product: Tomcat 9
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: fabian.lange@codecentric.de

This appears to be in the codebase since the beginning of time.

getMBeanServer() takes the start time, even when its never used (the local
variable has been inited).


    public synchronized MBeanServer getMBeanServer() {
        long t1=System.currentTimeMillis();
        if (server == null) {
            // ... t1 is used for debug logging.
        }
        return (server);
    }

Even when this method is not really hot, I guess it would make sense to move
this timing call down inside the if statement.

This issue applies to all (supported) tomcat versions. Shall I open a ticket
for each?

Because the patch is trivial, I assume it is easier for you to do it yourself,
rather than me attaching diff-patches.

-- 
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


[Bug 57625] tomcat.util.modeler.Registry.getMBeanServer() always gets the current system time

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

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

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

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Fixed in trunk along with a bunch of other clean-up in that method. Not worth
back-porting.

-- 
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