From: <do...@hy...> - 2007-10-24 21:43:21
|
Author: dougm Date: 2007-10-24 14:43:20 -0700 (Wed, 24 Oct 2007) New Revision: 6445 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=6445 Modified: trunk/src/org/hyperic/hq/product/Collector.java Log: [HHQ-1109] mask passwords in debug output Modified: trunk/src/org/hyperic/hq/product/Collector.java =================================================================== --- trunk/src/org/hyperic/hq/product/Collector.java 2007-10-24 21:41:15 UTC (rev 6444) +++ trunk/src/org/hyperic/hq/product/Collector.java 2007-10-24 21:43:20 UTC (rev 6445) @@ -346,8 +346,21 @@ this.endTime = System.currentTimeMillis(); } + String mapToString(Map map) { + Map props; + if (map.get(PROP_PASSWORD) != null) { + props = new HashMap(); + props.putAll(map); + props.put(PROP_PASSWORD, "*****"); + } + else { + props = map; + } + return props.toString(); + } + public String toString() { - return this.props.toString(); + return mapToString(this.props); } static class PluginContainer { |