commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <>
Subject [jira] [Commented] (DBCP-519) Add some toString() methods for debugging (never printing passwords)
Date Thu, 16 Aug 2018 21:03:00 GMT


Gary Gregory commented on DBCP-519:

Can't edit comments here? Annoying!
There is no sync control in the builders so returned data may be inconsistent (may be a practical
non-issue, but might be good to doc)
I think the simplest would be to mark the {{toString()}} methods as synchronized to get a
sane snapshot of an object. WDYT?

You should check to make sure you have not exposed more info on executing SQL than is already
available via JMX. That should be discussed if it is the case.
I have two goals:
- "see" objects in the debugging without drilling down
- toString() objects for debug logging
So JMX is orthogonal to me

The setup is nice and clean but I wonder if ongoing maintenance is going to be easy (just
really asking to look at the impl and think about what maintaining it is going to be like
as fields are added, etc)
As soon as you write any kind of toString(), you have extra maintenance. Simple when you remove
a field, easy to forget to update the toString() when you add one. The same can be said of
hashCode() and equals() methods.

> Add some toString() methods for debugging (never printing passwords)
> --------------------------------------------------------------------
>                 Key: DBCP-519
>                 URL:
>             Project: Commons DBCP
>          Issue Type: Improvement
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>            Priority: Major
>             Fix For: 2.6.0
> Add some toString() methods for debugging never printing passwords:
>  * org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS
>  * org.apache.commons.dbcp2.cpdsadapter.PooledConnectionImpl
>  * org.apache.commons.dbcp2.datasources.CPDSConnectionFactory
>  * org.apache.commons.dbcp2.datasources.InstanceKeyDataSource
>  * org.apache.commons.dbcp2.datasources.PerUserPoolDataSource
>  * org.apache.commons.dbcp2.datasources.SharedPoolDataSource
>  * org.apache.commons.dbcp2.datasources.UserPassKey (updated not to print passwords even
though it was a char[] reference.)
> I went YAGNI here and only added what I needed.

This message was sent by Atlassian JIRA

View raw message