[Bug 63981] New: False-positive warning logged when Registry.disableRegistry is called and the registry has already been disabled

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 63981] New: False-positive warning logged when Registry.disableRegistry is called and the registry has already been disabled

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63981

            Bug ID: 63981
           Summary: False-positive warning logged when
                    Registry.disableRegistry is called and the registry
                    has already been disabled
           Product: Tomcat 9
           Version: 9.0.x
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Util
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: -----

Calling org.apache.tomcat.util.modeler.Registry.disableRegistry() assigns an
instance of NoDescriptorRegistry to the static registry field. Subsequent
invocations then log a warning that states that the registry cannot be disabled
as it has already been initialised. These feels like a false-positive to me
when registry is an instance of NoDescriptorRegistry. To avoid the unwanted
warning, could the check be changed to something like the following:

if (registry == null) {
    registry = new NoDescriptorRegistry();
} else if (!registry instanceof NoDescriptorRegistry) {
    log.warn(sm.getString("registry.noDisable"));
}

This would improve log output in integration tests using embedded Tomcat where
Tomcat may be initialised multiple times.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63981] False-positive warning logged when Registry.disableRegistry is called and the registry has already been disabled

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63981

Phillip Webb <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63981] False-positive warning logged when Registry.disableRegistry is called and the registry has already been disabled

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63981

Mark Thomas <[hidden email]> changed:

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

--- Comment #1 from Mark Thomas <[hidden email]> ---
Thanks for the report and the suggested fix. Works for me.

Fixed in:
- master for 9.0.30 onwards

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63981] False-positive warning logged when Registry.disableRegistry is called and the registry has already been disabled

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63981

--- Comment #2 from Andy Wilkinson <[hidden email]> ---
Thanks, Mark. Much appreciated.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]