tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60381] New: Inconsistent toString() in ValveBase and RealmBase
Date Wed, 16 Nov 2016 12:38:14 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60381

            Bug ID: 60381
           Summary: Inconsistent toString() in ValveBase and RealmBase
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: 1983-01-06@gmx.net
  Target Milestone: ----

Moving several components from Tomcat 6.0.x to 8.5.x I have noticed that
#getInfo() is gone. RealmBase has an abstact method #getName() which is used in
#toString()(). ValveBase lacks this abstract method. This makes the #toString()
implementations inconsistent.

RealmBase:

> @Override
> public String toString() {
>     StringBuilder sb = new StringBuilder("Realm[");
>     sb.append(getName());
>     sb.append(']');
>     return sb.toString();
> }

ValveBase:

> @Override
> public String toString() {
>     StringBuilder sb = new StringBuilder(this.getClass().getName());
>     sb.append('[');
>     if (container == null) {
>         sb.append("Container is null");
>     } else {
>         sb.append(container.getName());
>     }
>     sb.append(']');
>     return sb.toString();
> }

I would rather expect a consistent behavior for both base implementations

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


Mime
View raw message