svn commit: r965916 - /ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r965916 - /ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java

doogie-3
Author: doogie
Date: Tue Jul 20 17:14:17 2010
New Revision: 965916

URL: http://svn.apache.org/viewvc?rev=965916&view=rev
Log:
Fix open file leak; the InputSource is only processed when a freemarker
template is given, so only attempt to create one if a template has been
specified.

Modified:
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=965916&r1=965915&r2=965916&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Tue Jul 20 17:14:17 2010
@@ -127,7 +127,7 @@ public class WebToolsServices {
         // #############################
         // The filename to parse is prepared
         // #############################
-        if (UtilValidate.isNotEmpty(filename)) {
+        if (UtilValidate.isNotEmpty(fmfilename) && UtilValidate.isNotEmpty(filename)) {
             try {
                 url = isUrl?FlexibleLocation.resolveLocation(filename):UtilURL.fromFilename(filename);
                 InputStream is = url.openStream();
@@ -144,7 +144,7 @@ public class WebToolsServices {
         // #############################
         // The text to parse is prepared
         // #############################
-        if (UtilValidate.isNotEmpty(fulltext)) {
+        if (UtilValidate.isNotEmpty(fmfilename) && UtilValidate.isNotEmpty(fulltext)) {
             StringReader sr = new StringReader(fulltext);
             ins = new InputSource(sr);
         }