You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2017/06/26 17:13:58 UTC

svn commit: r1799951 - /velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java

Author: cbrisson
Date: Mon Jun 26 17:13:58 2017
New Revision: 1799951

URL: http://svn.apache.org/viewvc?rev=1799951&view=rev
Log:
[tools] WebappLoader: Avoid extra exception logging when a file is not found

Note that whevever the WebappLoaded had several paths, each unsuccessful attempt were issuing an exception in the logs without this fix.


Modified:
    velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java

Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java?rev=1799951&r1=1799950&r2=1799951&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java (original)
+++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java Mon Jun 26 17:13:58 2017
@@ -147,7 +147,10 @@ public class WebappResourceLoader extend
             try
             {
                 rawStream = servletContext.getResourceAsStream(path);
-                result = buildReader(rawStream, encoding);
+                if (rawStream != null)
+                {
+                    result = buildReader(rawStream, encoding);
+                }
 
                 /* save the path and exit the loop if we found the template */
                 if (result != null)