moved close() of InputStream to finally block

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@765030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Koji Sekiguchi 2009-04-15 01:28:07 +00:00
parent a5a9be2d19
commit a31c7a692f
1 changed files with 10 additions and 5 deletions

View File

@ -132,11 +132,16 @@ public class VelocityResponseWriter implements QueryResponseWriter {
if( propFile == null )
engine.init();
else{
InputStream is = resourceLoader.getResourceStream( propFile );
Properties props = new Properties();
props.load( is );
is.close();
engine.init( props );
InputStream is = null;
try{
is = resourceLoader.getResourceStream( propFile );
Properties props = new Properties();
props.load( is );
engine.init( props );
}
finally{
if( is != null ) is.close();
}
}
}
catch( Exception e ){