[
https://issues.apache.org/jira/browse/GROOVY-8068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15856929#comment-15856929
]
ASF GitHub Bot commented on GROOVY-8068:
----------------------------------------
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.
> improper logging in groovy.sql.Sql
> ----------------------------------
>
> Key: GROOVY-8068
> URL: https://issues.apache.org/jira/browse/GROOVY-8068
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 2.4.8
> Environment: groovy-all-2.4.8-indy.jar
> Reporter: Frank Limpert
> Assignee: Paul King
> Priority: Minor
>
> In groovy.sql.Sql.newInstance(Map<String, Object>), there are two
> System.err.println() statements left. One of these prints the password of the
> connection to be created among other info. Convert these statements to proper
> log output.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)