groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleitner <...@git.apache.org>
Subject [GitHub] groovy pull request #491: GROOVY-8068: improper logging in groovy.sql.Sql
Date Tue, 07 Feb 2017 22:26:02 GMT
Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/491#discussion_r99946115
  
    --- Diff: subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java ---
    @@ -578,17 +578,26 @@ public static Sql newInstance(Map<String, Object> args) throws
SQLException, Cla
     
             Object url = sqlArgs.remove("url");
             Connection connection;
    +        LOG.fine("url = " + url);
             if (props != null) {
    -            System.err.println("url = " + url);
    -            System.err.println("props = " + props);
    -            connection = DriverManager.getConnection(url.toString(), new Properties(props));
    +            Properties propsCopy = new Properties(props);
    +            connection = DriverManager.getConnection(url.toString(), propsCopy);
    +            if (propsCopy.containsKey("password")) {
    +                // don't log the password
    +                propsCopy = new Properties(propsCopy);
    --- End diff --
    
    That makes sense, I missed that the copy was passed to the DriverManager.  Sorry for the
noise.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message