struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1433644 - in /struts/struts2/trunk: core/src/main/java/org/apache/struts2/components/ core/src/main/java/org/apache/struts2/config/ core/src/main/java/org/apache/struts2/dispatcher/ core/src/main/java/org/apache/struts2/dispatcher/ng/ core...
Date Tue, 15 Jan 2013 20:58:09 GMT
Author: lukaszlenart
Date: Tue Jan 15 20:58:08 2013
New Revision: 1433644

URL: http://svn.apache.org/viewvc?rev=1433644&view=rev
Log:
Improves logging of exceptions

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ClosingUIBean.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/VelocityResult.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/SubsetIteratorFilter.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TokenHelper.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/TagModel.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/IteratorTag.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/StrutsResourceLoader.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/AdapterFactory.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/BeanAdapter.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultObjectTypeDeterminer.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptor.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/PrefixMethodInvocationUtil.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/DomHelper.java
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/finder/ResourceFinder.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ClosingUIBean.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ClosingUIBean.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ClosingUIBean.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ClosingUIBean.java Tue Jan 15 20:58:08 2013
@@ -21,16 +21,14 @@
 
 package org.apache.struts2.components;
 
-import java.io.Writer;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import org.apache.struts2.views.annotations.StrutsTagAttribute;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.Writer;
 
 /**
  * ClosingUIBean is the standard superclass for UI components such as div etc.
@@ -59,7 +57,6 @@ public abstract class ClosingUIBean exte
             mergeTemplate(writer, buildTemplateName(openTemplate, getDefaultOpenTemplate()));
         } catch (Exception e) {
             LOG.error("Could not open template", e);
-            e.printStackTrace();
         }
 
         return result;

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java Tue Jan 15 20:58:08 2013
@@ -275,21 +275,19 @@ public class Date extends ContextBean {
     }
 
     public boolean end(Writer writer, String body) {
-        String msg = null;
+        String msg;
         java.util.Date date = null;
         // find the name on the valueStack
         try {
             //suport Calendar also
             Object dateObject = findValue(name);
-            if (dateObject instanceof java.util.Date)
+            if (dateObject instanceof java.util.Date) {
                 date = (java.util.Date) dateObject;
-            else if(dateObject instanceof Calendar)
+            } else if(dateObject instanceof Calendar){
                 date = ((Calendar) dateObject).getTime();
+            }
         } catch (Exception e) {
-            LOG.error("Could not convert object with key '" + name
-                    + "' to a java.util.Date instance");
-            // bad date, return a blank instead ?
-            msg = "";
+            LOG.error("Could not convert object with key '#0' to a java.util.Date instance", name);
         }
 
         //try to find the format on the stack

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java Tue Jan 15 20:58:08 2013
@@ -348,11 +348,11 @@ public class BeanSelectionProvider imple
                 String name = customBundles.nextToken();
                 try {
                     if (LOG.isInfoEnabled()) {
-                	    LOG.info("Loading global messages from " + name);
+                	    LOG.info("Loading global messages from [#0]", name);
                     }
                     LocalizedTextUtil.addDefaultResourceBundle(name);
                 } catch (Exception e) {
-                    LOG.error("Could not find messages file " + name + ".properties. Skipping");
+                    LOG.error("Could not find messages file #0.properties. Skipping", name);
                 }
             }
         }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java Tue Jan 15 20:58:08 2013
@@ -285,7 +285,7 @@ public class Dispatcher {
             }
             catch(Exception e) {
                 // catch any exception that may occurred during destroy() and log it
-                LOG.error("exception occurred while destroying ObjectFactory ["+objectFactory+"]", e);
+                LOG.error("exception occurred while destroying ObjectFactory [#0]", e, objectFactory.toString());
             }
         }
 

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/VelocityResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/VelocityResult.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/VelocityResult.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/VelocityResult.java Tue Jan 15 20:58:08 2013
@@ -159,15 +159,15 @@ public class VelocityResult extends Stru
             // to do it all the time (WW-829). Since Velocity support is being deprecated, we'll oblige :)
             writer.flush();
         } catch (Exception e) {
-            LOG.error("Unable to render Velocity Template, '" + finalLocation + "'", e);
+            if (LOG.isErrorEnabled()) {
+                LOG.error("Unable to render Velocity Template, '#0'", e, finalLocation);
+            }
             throw e;
         } finally {
             if (usedJspFactory) {
                 jspFactory.releasePageContext(pageContext);
             }
         }
-
-        return;
     }
 
     /**

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java Tue Jan 15 20:58:08 2013
@@ -133,8 +133,7 @@ public class PrepareOperations {
             // parameters might not be accessible through before encoding (ww-1278)
             request = dispatcher.wrapRequest(request, servletContext);
         } catch (IOException e) {
-            String message = "Could not wrap servlet request with MultipartRequestWrapper!";
-            throw new ServletException(message, e);
+            throw new ServletException("Could not wrap servlet request with MultipartRequestWrapper!", e);
         }
         return request;
     }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java Tue Jan 15 20:58:08 2013
@@ -117,7 +117,9 @@ public class StrutsUtil {
             return responseWrapper.getData();
         }
         catch (Exception e) {
-            e.printStackTrace();
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Cannot include #0", e, aName.toString());
+            }
             throw e;
         }
     }
@@ -126,6 +128,9 @@ public class StrutsUtil {
         try {
             return URLEncoder.encode(s, "UTF-8");
         } catch (UnsupportedEncodingException e) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Cannot encode URL [#0]", e, s);
+            }
             return s;
         }
     }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/SubsetIteratorFilter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/SubsetIteratorFilter.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/SubsetIteratorFilter.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/SubsetIteratorFilter.java Tue Jan 15 20:58:08 2013
@@ -21,14 +21,14 @@
 
 package org.apache.struts2.util;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 
 /**
  * A bean that takes an iterator and outputs a subset of it.
@@ -168,7 +168,8 @@ public class SubsetIteratorFilter extend
             }
             catch(Exception e) {
                 if (LOG.isWarnEnabled()) {
-                    LOG.warn("decider ["+decider+"] encountered an error while decide adding element ["+element+"], element will be ignored, it will not appeared in subseted iterator", e);
+                    LOG.warn("Decider [#0] encountered an error while decide adding element [#1], element will be ignored, it will not appeared in subseted iterator",
+                            e, decider.toString(), element.toString());
                 }
                 return false;
             }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TokenHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TokenHelper.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TokenHelper.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TokenHelper.java Tue Jan 15 20:58:08 2013
@@ -21,15 +21,15 @@
 
 package org.apache.struts2.util;
 
-import java.math.BigInteger;
-import java.util.Map;
-import java.util.Random;
-
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.util.LocalizedTextUtil;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 
+import java.math.BigInteger;
+import java.util.Map;
+import java.util.Random;
+
 /**
  * TokenHelper
  *
@@ -90,8 +90,10 @@ public class TokenHelper {
 			session.put(buildTokenSessionAttributeName(tokenName), token);
 		} catch ( IllegalStateException e ) {
 			// WW-1182 explain to user what the problem is
-			String msg = "Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: " + e.getMessage();
-			LOG.error(msg, e);
+            String msg = "Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: " + e.getMessage();
+            if (LOG.isErrorEnabled()) {
+                LOG.error(msg, e);
+            }
 			throw new IllegalArgumentException(msg);
 		}
 	}

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java Tue Jan 15 20:58:08 2013
@@ -44,7 +44,9 @@ public class JBossFileManager extends De
             Class.forName(VFS_JBOSS5);
             return true;
         } catch (ClassNotFoundException e) {
-            LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS7);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS7);
+            }
             return false;
         }
     }
@@ -54,7 +56,9 @@ public class JBossFileManager extends De
             Class.forName(VFS_JBOSS7);
             return true;
         } catch (ClassNotFoundException e) {
-            LOG.debug("Cannot load [#0] class, not a JBoss 7!", VFS_JBOSS7);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Cannot load [#0] class, not a JBoss 7!", VFS_JBOSS7);
+            }
             return false;
         }
     }
@@ -79,7 +83,9 @@ public class JBossFileManager extends De
             try {
                 return getJBossPhysicalUrl(url);
             } catch (IOException e) {
-                LOG.error(e.getMessage(), e);
+                if (LOG.isErrorEnabled()) {
+                    LOG.error(e.getMessage(), e);
+                }
                 return null;
             }
         } else {

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java Tue Jan 15 20:58:08 2013
@@ -253,7 +253,9 @@ public class FreemarkerManager {
             try {
                 init(servletContext);
             } catch (TemplateException e) {
-                LOG.error("Cannot load freemarker configuration: ",e);
+                if (LOG.isErrorEnabled()) {
+                    LOG.error("Cannot load freemarker configuration: ",e);
+                }
             }
 //            config = createConfiguration(servletContext);
 
@@ -409,7 +411,9 @@ public class FreemarkerManager {
                  }
              }
          } catch (IOException e) {
-             LOG.error("Invalid template path specified: " + e.getMessage(), e);
+             if (LOG.isErrorEnabled()) {
+                LOG.error("Invalid template path specified: #0", e, e.getMessage());
+             }
          }
 
          // presume that most apps will require the class and webapp template loader
@@ -459,9 +463,13 @@ public class FreemarkerManager {
                 }
             }
         } catch (IOException e) {
-            LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
+            if (LOG.isErrorEnabled()) {
+                LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
+            }
         } catch (TemplateException e) {
-            LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
+            if (LOG.isErrorEnabled()) {
+                LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
+            }
         } finally {
             if (in != null) {
                 try {

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/TagModel.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/TagModel.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/TagModel.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/TagModel.java Tue Jan 15 20:58:08 2013
@@ -81,11 +81,11 @@ public abstract class TagModel implement
                 // the value should ALWAYS be a decendant of TemplateModel
                 if (value instanceof TemplateModel) {
                     try {
-                        map.put(entry.getKey(), objectWrapper
-                            .unwrap((TemplateModel) value));
+                        map.put(entry.getKey(), objectWrapper.unwrap((TemplateModel) value));
                     } catch (TemplateModelException e) {
-                        LOG.error("failed to unwrap [" + value
-                            + "] it will be ignored", e);
+                        if (LOG.isErrorEnabled()) {
+                            LOG.error("failed to unwrap [#0] it will be ignored", e, value.toString());
+                        }
                     }
                 }
                 // if it doesn't, we'll do it the old way by just returning the toString() representation
@@ -123,7 +123,9 @@ public abstract class TagModel implement
                     try {
                         map.put(entry.getKey(), ((SimpleSequence) value).toList());
                     } catch (TemplateModelException e) {
-                        LOG.error("There was a problem converting a SimpleSequence to a list", e);
+                        if (LOG.isErrorEnabled()) {
+                            LOG.error("There was a problem converting a SimpleSequence to a list", e);
+                        }
                     }
                 }
             }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/IteratorTag.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/IteratorTag.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/IteratorTag.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/IteratorTag.java Tue Jan 15 20:58:08 2013
@@ -21,14 +21,13 @@
 
 package org.apache.struts2.views.jsp;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.JspException;
-
+import com.opensymphony.xwork2.util.ValueStack;
 import org.apache.struts2.components.Component;
 import org.apache.struts2.components.IteratorComponent;
 
-import com.opensymphony.xwork2.util.ValueStack;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
 
 /**
  * @see IteratorComponent
@@ -93,7 +92,7 @@ public class IteratorTag extends Context
                 try {
                     bodyContent.writeOut(bodyContent.getEnclosingWriter());
                 } catch (Exception e) {
-                    throw new JspException(e.getMessage());
+                    throw new JspException(e);
                 }
             }
             return SKIP_BODY;

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java Tue Jan 15 20:58:08 2013
@@ -183,8 +183,9 @@ public class DefaultUrlHelper implements
         try {
             result = encodeResult ? response.encodeURL(result) : result;
         } catch (Exception ex) {
-            // Could not encode the URL for some reason
-            // Use it unchanged
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Could not encode the URL for some reason, use it unchanged", ex);
+            }
             result = link.toString();
         }
 
@@ -259,7 +260,7 @@ public class DefaultUrlHelper implements
             return URLEncoder.encode(translatedInput, encoding);
         } catch (UnsupportedEncodingException e) {
             if (LOG.isWarnEnabled()) {
-                LOG.warn("Could not encode URL parameter '" + input + "', returning value un-encoded");
+                LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
             }
             return translatedInput;
         }
@@ -271,7 +272,7 @@ public class DefaultUrlHelper implements
             return URLDecoder.decode(translatedInput, encoding);
         } catch (UnsupportedEncodingException e) {
             if (LOG.isWarnEnabled()) {
-                LOG.warn("Could not encode URL parameter '" + input + "', returning value un-encoded");
+                LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
             }
             return translatedInput;
         }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/StrutsResourceLoader.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/StrutsResourceLoader.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/StrutsResourceLoader.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/StrutsResourceLoader.java Tue Jan 15 20:58:08 2013
@@ -46,7 +46,7 @@ public class StrutsResourceLoader extend
         try {
             return ClassLoaderUtil.getResourceAsStream(name, StrutsResourceLoader.class);
         } catch (Exception e) {
-            throw new ResourceNotFoundException(e.getMessage());
+            throw new ResourceNotFoundException(e);
         }
     }
 }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java Tue Jan 15 20:58:08 2013
@@ -156,7 +156,9 @@ public class VelocityManager {
             ctx = ServletActionContext.getServletContext();
         } catch (NullPointerException npe) {
             // in case this was used outside the lifecycle of struts servlet
-            LOG.debug("internal toolbox context ignored");
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("internal toolbox context ignored");
+            }
         }
 
         if (toolboxManager != null && ctx != null) {
@@ -454,8 +456,7 @@ public class VelocityManager {
         try {
             velocityEngine.init(p);
         } catch (Exception e) {
-            String gripe = "Unable to instantiate VelocityEngine!";
-            throw new StrutsException(gripe, e);
+            throw new StrutsException("Unable to instantiate VelocityEngine!", e);
         }
 
         return velocityEngine;

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/AdapterFactory.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/AdapterFactory.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/AdapterFactory.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/AdapterFactory.java Tue Jan 15 20:58:08 2013
@@ -21,10 +21,6 @@
 
 package org.apache.struts2.views.xslt;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.struts2.StrutsException;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -33,6 +29,10 @@ import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
 
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * AdapterFactory produces Node adapters for Java object types.
  * Adapter classes are generally instantiated dynamically via a no-args constructor
@@ -215,11 +215,9 @@ public class AdapterFactory {
             return adapterNode;
 
         } catch (IllegalAccessException e) {
-            e.printStackTrace();
-            throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage());
+            throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage(), e);
         } catch (InstantiationException e) {
-            e.printStackTrace();
-            throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage());
+            throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage(), e);
         }
     }
 

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/BeanAdapter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/BeanAdapter.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/BeanAdapter.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/BeanAdapter.java Tue Jan 15 20:58:08 2013
@@ -21,6 +21,12 @@
 
 package org.apache.struts2.views.xslt;
 
+import com.opensymphony.xwork2.util.logging.Logger;
+import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import org.apache.struts2.StrutsException;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
@@ -31,13 +37,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.struts2.StrutsException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
 
 /**
  * This class is the most general type of adapter, utilizing reflective introspection to present a DOM view of all of
@@ -123,7 +122,9 @@ public class BeanAdapter extends Abstrac
                 } catch (Exception e) {
                     if (e instanceof InvocationTargetException)
                         e = (Exception) ((InvocationTargetException) e).getTargetException();
-                    log.error("Cannot access bean property: "+propertyName, e);
+                    if (log.isErrorEnabled()) {
+                        log.error("Cannot access bean property: #0", e, propertyName);
+                    }
                     continue;
                 }
 

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java Tue Jan 15 20:58:08 2013
@@ -21,12 +21,17 @@
 
 package org.apache.struts2.views.xslt;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.Result;
+import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.util.TextParseUtil;
+import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.util.logging.Logger;
+import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.StrutsConstants;
+import org.apache.struts2.StrutsException;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.xml.transform.ErrorListener;
@@ -40,19 +45,11 @@ import javax.xml.transform.URIResolver;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-
-import org.apache.struts2.ServletActionContext;
-import org.apache.struts2.StrutsConstants;
-import org.apache.struts2.StrutsException;
-
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.Result;
-import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.util.TextParseUtil;
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
 
 /**
@@ -398,7 +395,9 @@ public class XSLTResult implements Resul
             }
 
         } catch (Exception e) {
-            LOG.error("Unable to render XSLT Template, '" + location + "'", e);
+            if (LOG.isErrorEnabled()) {
+                LOG.error("Unable to render XSLT Template, '#0'", e, location);
+            }
             throw e;
         }
     }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java Tue Jan 15 20:58:08 2013
@@ -201,7 +201,9 @@ public class DefaultActionInvocation imp
         try {
             resultConfig = results.get(resultCode);
         } catch (NullPointerException e) {
-            // swallow
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Got NPE trying to read result configuration for resultCode [#0]", resultCode);
+            }
         }
         
         if (resultConfig == null) {
@@ -213,7 +215,9 @@ public class DefaultActionInvocation imp
             try {
                 return objectFactory.buildResult(resultConfig, invocationContext.getContextMap());
             } catch (Exception e) {
-                LOG.error("There was an exception while instantiating the result of type " + resultConfig.getClassName(), e);
+                if (LOG.isErrorEnabled()) {
+                    LOG.error("There was an exception while instantiating the result of type #0", e, resultConfig.getClassName());
+                }
                 throw new XWorkException(e, resultConfig);
             }
         } else if (resultCode != null && !Action.NONE.equals(resultCode) && unknownHandlerManager.hasUnknownHandlers()) {

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java Tue Jan 15 20:58:08 2013
@@ -150,7 +150,7 @@ public class ConfigurationManager {
             containerProvider.destroy();
         } catch (Exception e) {
             if (LOG.isWarnEnabled()) {
-                LOG.warn("Error while destroying container provider [" + containerProvider + "]", e);
+                LOG.warn("Error while destroying container provider [#0]", e, containerProvider.toString());
             }
         }
     }
@@ -221,7 +221,7 @@ public class ConfigurationManager {
                 containerProvider.destroy();
             } catch (Exception e) {
                 if (LOG.isWarnEnabled()) {
-                    LOG.warn("error while destroying configuration provider [" + containerProvider + "]", e);
+                    LOG.warn("error while destroying configuration provider [#0]", e, containerProvider.toString());
                 }
             }
         }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java Tue Jan 15 20:58:08 2013
@@ -71,9 +71,8 @@ public class InterceptorBuilder {
                     result.add(new InterceptorMapping(refName, inter));
                 } catch (ConfigurationException ex) {
                     if (LOG.isWarnEnabled()) {
-                	LOG.warn("Unable to load config class " + config.getClassName() + " at " +
-                            ex.getLocation() + " probably due to a missing jar, which might " +
-                            "be fine if you never plan to use the " + config.getName() + " interceptor");
+                	    LOG.warn("Unable to load config class #0 at #1 probably due to a missing jar, which might be fine if you never plan to use the #2 interceptor",
+                            config.getClassName(), ex.getLocation().toString(), config.getName());
                     }
                     LOG.error("Actual exception", ex);
                 }
@@ -150,7 +149,7 @@ public class InterceptorBuilder {
 
             } catch (Exception e) {
                 if (LOG.isWarnEnabled()) {
-                    LOG.warn("No interceptor found for name = " + key);
+                    LOG.warn("No interceptor found for name = #0", key);
                 }
             }
         }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java Tue Jan 15 20:58:08 2013
@@ -244,7 +244,9 @@ public class XmlConfigurationProvider im
                             if (!optional) {
                                 throw new ConfigurationException("Unable to load bean: type:" + type + " class:" + impl, ex, childNode);
                             } else {
-                                LOG.debug("Unable to load optional class: " + ex);
+                                if (LOG.isDebugEnabled()) {
+                                    LOG.debug("Unable to load optional class: #0", ex, impl);
+                                }
                             }
                         }
                     } else if ("constant".equals(nodeName)) {
@@ -475,18 +477,18 @@ public class XmlConfigurationProvider im
             }
         } catch (ClassNotFoundException e) {
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Class not found for action [" + className + "]", e);
+                LOG.debug("Class not found for action [#0]", e, className);
             }
             throw new ConfigurationException("Action class [" + className + "] not found", loc);
         } catch (NoSuchMethodException e) {
             if (LOG.isDebugEnabled()) {
-                LOG.debug("No constructor found for action [" + className + "]", e);
+                LOG.debug("No constructor found for action [#0]", e, className);
             }
             throw new ConfigurationException("Action class [" + className + "] does not have a public no-arg constructor", e, loc);
         } catch (RuntimeException ex) {
             // Probably not a big deal, like request or session-scoped Spring 2 beans that need a real request
             if (LOG.isInfoEnabled()) {
-            LOG.info("Unable to verify action class [" + className + "] exists at initialization");
+                LOG.info("Unable to verify action class [#0] exists at initialization", className);
             }
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Action verification cause", ex);
@@ -494,7 +496,7 @@ public class XmlConfigurationProvider im
         } catch (Exception ex) {
             // Default to failing fast
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Unable to verify action class [" + className + "]", ex);
+                LOG.debug("Unable to verify action class [#0]", ex, className);
             }
             throw new ConfigurationException(ex, loc);
         }
@@ -567,7 +569,9 @@ public class XmlConfigurationProvider im
                     paramName = (String) clazz.getField("DEFAULT_PARAM").get(null);
                 }
                 catch (Throwable t) {
-                    // if we get here, the result type doesn't have a default param defined.
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("The result type doesn't have a default param defined", t);
+                    }
                 }
                 ResultTypeConfig.Builder resultType = new ResultTypeConfig.Builder(name, className).defaultResultParam(paramName)
                         .location(DomHelper.getLocationObject(resultTypeElement));
@@ -592,13 +596,11 @@ public class XmlConfigurationProvider im
             return objectFactory.getClassInstance(className);
         } catch (ClassNotFoundException e) {
             if (LOG.isWarnEnabled()) {
-            LOG.warn("Result class [" + className + "] doesn't exist (ClassNotFoundException) at " +
-                    loc.toString() + ", ignoring", e);
+                LOG.warn("Result class [#0] doesn't exist (ClassNotFoundException) at #1, ignoring", e, className, loc.toString());
             }
         } catch (NoClassDefFoundError e) {
             if (LOG.isWarnEnabled()) {
-            LOG.warn("Result class [" + className + "] doesn't exist (NoClassDefFoundError) at " +
-                    loc.toString() + ", ignoring", e);
+                LOG.warn("Result class [#0] doesn't exist (NoClassDefFoundError) at #1, ignoring", e, className, loc.toString());
             }
         }
 
@@ -1012,8 +1014,7 @@ public class XmlConfigurationProvider im
                         throw new ConfigurationException("Unable to load " + url, e);
                     }
                 } catch (Exception e) {
-                    final String s = "Caught exception while loading file " + fileName;
-                    throw new ConfigurationException(s, e, includeElement);
+                    throw new ConfigurationException("Caught exception while loading file " + fileName, e, includeElement);
                 } finally {
                     if (is != null) {
                         try {

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultObjectTypeDeterminer.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultObjectTypeDeterminer.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultObjectTypeDeterminer.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultObjectTypeDeterminer.java Tue Jan 15 20:58:08 2013
@@ -300,7 +300,7 @@ public class DefaultObjectTypeDeterminer
             }
         } catch (Exception e) {
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Error while retrieving generic property class for property=" + property, e);
+                LOG.debug("Error while retrieving generic property class for property = #0", e, property);
             }
         }
         return null;

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java Tue Jan 15 20:58:08 2013
@@ -140,7 +140,9 @@ public class InstantiatingNullHandler im
 
             return param;
         } catch (Exception e) {
-            LOG.error("Could not create and/or set value back on to object", e);
+            if (LOG.isErrorEnabled()) {
+                LOG.error("Could not create and/or set value back on to object", e);
+            }
         }
 
         return null;

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java Tue Jan 15 20:58:08 2013
@@ -388,7 +388,9 @@ public class XWorkConverter extends Defa
             try {
                 clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
             } catch (ClassNotFoundException cnfe) {
-                //swallow
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Cannot load class #0", cnfe, className);
+                }
             }
 
             result = lookupSuper(clazz);
@@ -565,7 +567,9 @@ public class XWorkConverter extends Defa
                 }
             }
         } catch (Exception ex) {
-            LOG.error("Problem loading properties for " + clazz.getName(), ex);
+            if (LOG.isErrorEnabled()) {
+                LOG.error("Problem loading properties for #0", ex, clazz.getName());
+            }
         }
 
         // Process annotations
@@ -632,6 +636,9 @@ public class XWorkConverter extends Defa
                                 }
                             }
                         } catch (Exception e) {
+                            if (LOG.isDebugEnabled()) {
+                                LOG.debug("Got exception for #0", e, key);
+                            }
                         }
                     }
                 }
@@ -707,6 +714,9 @@ public class XWorkConverter extends Defa
                                 }
                             }
                         } catch (Exception e) {
+                            if (LOG.isDebugEnabled()) {
+                                LOG.debug("Got exception for #0", e, key);
+                            }
                         }
                     }
                 }
@@ -813,7 +823,9 @@ public class XWorkConverter extends Defa
             if (require) {
                 throw new XWorkException("Cannot load conversion properties file: "+propsName, ex);
             } else {
-                LOG.debug("Cannot load conversion properties file: "+propsName, ex);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Cannot load conversion properties file: #0", ex, propsName);
+                }
             }
         }
     }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptor.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptor.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptor.java Tue Jan 15 20:58:08 2013
@@ -114,7 +114,9 @@ public class ParameterRemoverInterceptor
                                 parameters.remove(removeName);
                             }
                         } catch (Exception e) {
-                            LOG.error("Failed to convert parameter to string", e);
+                            if (LOG.isErrorEnabled()) {
+                                LOG.error("Failed to convert parameter to string", e);
+                            }
                         }
                     }
                 }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/PrefixMethodInvocationUtil.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/PrefixMethodInvocationUtil.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/PrefixMethodInvocationUtil.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/PrefixMethodInvocationUtil.java Tue Jan 15 20:58:08 2013
@@ -147,7 +147,7 @@ public class PrefixMethodInvocationUtil 
             catch (NoSuchMethodException e) {
                 // hmm -- OK, try next prefix
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug("cannot find method [" + prefixedMethodName + "] in action [" + action + "]");
+                    LOG.debug("cannot find method [#0] in action [#1]", prefixedMethodName, action.toString());
                 }
             }
         }

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java Tue Jan 15 20:58:08 2013
@@ -281,8 +281,9 @@ public class OgnlUtil {
             fromPds = getPropertyDescriptors(from);
             toPds = getPropertyDescriptors(to);
         } catch (IntrospectionException e) {
-            LOG.error("An error occured", e);
-
+            if (LOG.isErrorEnabled()) {
+                LOG.error("An error occured", e);
+            }
             return;
         }
 
@@ -309,7 +310,9 @@ public class OgnlUtil {
                             Object value = Ognl.getValue(expr, contextFrom, from);
                             Ognl.setValue(expr, contextTo, to, value);
                         } catch (OgnlException e) {
-                            // ignore, this is OK
+                            if (LOG.isDebugEnabled()) {
+                                LOG.debug("Got OGNL exception", e);
+                            }
                         }
                     }
 

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java Tue Jan 15 20:58:08 2013
@@ -206,9 +206,13 @@ public class CompoundRootAccessor implem
 
                 return sb.toString();
             } catch (IntrospectionException e) {
-                e.printStackTrace();
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Got exception in callMethod", e);
+                }
             } catch (OgnlException e) {
-                e.printStackTrace();
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Got exception in callMethod", e);
+                }
             }
 
             return null;
@@ -273,7 +277,9 @@ public class CompoundRootAccessor implem
                 }
             }
         } catch (Exception e) {
-            // just try the old fashioned way
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Got exception when tried to get class for name [#0]", e, className);
+            }
         }
 
         return Thread.currentThread().getContextClassLoader().loadClass(className);

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/DomHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/DomHelper.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/DomHelper.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/DomHelper.java Tue Jan 15 20:58:08 2013
@@ -82,10 +82,14 @@ public class DomHelper {
                 factory = (SAXParserFactory) clazz.newInstance();
             }
             catch (ClassNotFoundException e) {
-                LOG.error("Unable to load saxParserFactory set by system property 'xwork.saxParserFactory': " + parserProp, e);
+                if (LOG.isErrorEnabled()) {
+                    LOG.error("Unable to load saxParserFactory set by system property 'xwork.saxParserFactory': #0", e, parserProp);
+                }
             }
             catch (Exception e) {
-                LOG.error("Unable to load saxParserFactory set by system property 'xwork.saxParserFactory': " + parserProp, e);
+                if (LOG.isErrorEnabled()) {
+                    LOG.error("Unable to load saxParserFactory set by system property 'xwork.saxParserFactory': #0", e, parserProp);
+                }
             }
         }
 
@@ -148,10 +152,14 @@ public class DomHelper {
                     FACTORY = (SAXTransformerFactory) clazz.newInstance();
                 }
                 catch (ClassNotFoundException e) {
-                    LOG.error("Unable to load SAXTransformerFactory set by system property 'xwork.saxTransformerFactory': " + parserProp, e);
+                    if (LOG.isErrorEnabled()) {
+                        LOG.error("Unable to load SAXTransformerFactory set by system property 'xwork.saxTransformerFactory': #0", e, parserProp);
+                    }
                 }
                 catch (Exception e) {
-                    LOG.error("Unable to load SAXTransformerFactory set by system property 'xwork.saxTransformerFactory': " + parserProp, e);
+                    if (LOG.isErrorEnabled()) {
+                        LOG.error("Unable to load SAXTransformerFactory set by system property 'xwork.saxTransformerFactory': #0", e, parserProp);
+                    }
                 }
             }
 

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/finder/ResourceFinder.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/finder/ResourceFinder.java?rev=1433644&r1=1433643&r2=1433644&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/finder/ResourceFinder.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/finder/ResourceFinder.java Tue Jan 15 20:58:08 2013
@@ -15,20 +15,33 @@
  */
 package com.opensymphony.xwork2.util.finder;
 
+import com.opensymphony.xwork2.util.logging.Logger;
+import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import org.apache.commons.lang3.StringUtils;
 
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.*;
-import java.util.*;
+import java.net.HttpURLConnection;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Vector;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
 /**
  * @author David Blevins
  * @version $Rev$ $Date$
@@ -823,6 +836,9 @@ public class ResourceFinder {
 
                 }
             } catch (Exception e) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Got exception loading resources for #0", e, uri);
+                }
             }
         }
 
@@ -855,6 +871,9 @@ public class ResourceFinder {
 
                 }
             } catch (Exception e) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Got exception search for subpackages for #0", e, uri);
+                }
             }
         }
 
@@ -887,6 +906,9 @@ public class ResourceFinder {
                     result.put(location, convertPathsToPackages(resources));
                 }
             } catch (Exception e) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Got exception finding subpackages for #0", e, uri);
+                }
             }
         }
 



Mime
View raw message