Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2)

125907 mward: ACE-5052: close PrintWriter


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@125933 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandra Leahu
2016-04-28 09:15:22 +00:00
parent e503014fe7
commit e52c6301a4

View File

@@ -1976,8 +1976,11 @@ public class SchemaBootstrap extends AbstractLifecycleBean
dialect.getClass().getSimpleName(),
reference.getDbPrefix()
};
PrintWriter pw;
PrintWriter pw = null;
File outputFile = null;
try
{
if (out == null)
{
String outputFileName = MessageFormat.format(outputFileNameTemplate, outputFileNameParams);
@@ -2008,12 +2011,16 @@ public class SchemaBootstrap extends AbstractLifecycleBean
pw.print(result.describe());
pw.print(SchemaComparator.LINE_SEPARATOR);
}
}
finally
{
// We care only about output streams for reporting, which are created specially for current reference resource...
if (null == out)
{
pw.close();
}
}
if (results.size() == 0)
{