You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/04/23 10:06:14 UTC

svn commit: r1470843 - in /myfaces/tobago/branches/tobago-1.0.x: core/src/main/java/org/apache/myfaces/tobago/renderkit/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/

Author: lofwyr
Date: Tue Apr 23 08:06:13 2013
New Revision: 1470843

URL: http://svn.apache.org/r1470843
Log:
TOBAGO-1254: Improve logging

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java?rev=1470843&r1=1470842&r2=1470843&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java Tue Apr 23 08:06:13 2013
@@ -19,8 +19,10 @@
 
 package org.apache.myfaces.tobago.renderkit;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.TobagoConstants;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 
 import javax.faces.component.UIComponent;
@@ -49,14 +51,13 @@ public class InputRendererBase extends L
     Map requestParameterMap = context.getExternalContext()
         .getRequestParameterMap();
     if (requestParameterMap.containsKey(clientId)) {
+      String newValue = (String) requestParameterMap.get(clientId);
       if (LOG.isDebugEnabled()) {
+        final boolean password = ComponentUtil.getBooleanAttribute(component, TobagoConstants.ATTR_PASSWORD);
         LOG.debug("clientId = '" + clientId + "'");
         LOG.debug("requestParameterMap.get(clientId) = '"
-            + requestParameterMap.get(clientId) + "'");
-        LOG.debug("requestParameterMap.get(clientId).getClass().getName() = '"
-            + requestParameterMap.get(clientId).getClass().getName() + "'");
+            + (password ? StringUtils.leftPad("", newValue.length(), '*') : newValue) + "'");
       }
-      String newValue = (String) requestParameterMap.get(clientId);
       uiInput.setSubmittedValue(newValue);
     }
   }

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java?rev=1470843&r1=1470842&r2=1470843&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java Tue Apr 23 08:06:13 2013
@@ -100,11 +100,7 @@ public class RendererBase extends Render
 
   protected Object getValue(UIComponent component) {
     if (component instanceof ValueHolder) {
-      Object value = ((ValueHolder) component).getValue();
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("component.getValue() returned " + value);
-      }
-      return value;
+      return ((ValueHolder) component).getValue();
     } else {
       return null;
     }

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java?rev=1470843&r1=1470842&r2=1470843&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java Tue Apr 23 08:06:13 2013
@@ -24,6 +24,7 @@ package org.apache.myfaces.tobago.render
  * $Id$
  */
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.ajax.api.AjaxPhaseListener;
@@ -67,12 +68,14 @@ public class InRenderer extends InputRen
 
     String title = HtmlRendererUtil.getTitleFromTipAndMessages(facesContext, input);
 
+    final boolean password = ComponentUtil.getBooleanAttribute(input, ATTR_PASSWORD);
     String currentValue = getCurrentValue(facesContext, input);
     if (LOG.isDebugEnabled()) {
-      LOG.debug("currentValue = '" + currentValue + "'");
+      LOG.debug("currentValue = '" +
+          (password && currentValue != null ? StringUtils.leftPad("", currentValue.length(), '*') : currentValue)
+          + "'");
     }
-    String type = ComponentUtil.getBooleanAttribute(input,
-        ATTR_PASSWORD) ? "password" : "text";
+    String type = password ? "password" : "text";
 
     // Todo: check for valid binding
     boolean renderAjaxSuggest = input.getSuggestMethod() != null;