Author: vyemialyanchyk
Date: 2009-04-09 10:21:04 -0400 (Thu, 09 Apr 2009)
New Revision: 14637
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
Log:
JBIDE-4138 - just for SeamGenAction code cleanup
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2009-04-09
14:16:36 UTC (rev 14636)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2009-04-09
14:21:04 UTC (rev 14637)
@@ -311,9 +311,11 @@
if(!empties.isEmpty()) {
File createTempFile = null;
+ FileOutputStream fos = null;
try {
createTempFile = File.createTempFile( "seamgenempty",
"properties" );
- empties.store( new FileOutputStream(createTempFile), "File used to send
intentionally empty valued properties" );
+ fos = new FileOutputStream(createTempFile);
+ empties.store( fos, "File used to send intentionally empty valued
properties" );
}
catch (FileNotFoundException e) {
SeamGenPlugin.logError( "Error while running " + getTarget(), e );
@@ -321,6 +323,15 @@
catch (IOException e) {
SeamGenPlugin.logError( "Error while running " + getTarget(), e );
}
+ finally {
+ if (fos != null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
if(createTempFile!=null) {
wc.setAttribute( IAntLaunchConfigurationConstants.ATTR_ANT_PROPERTY_FILES,
createTempFile.toString() );
@@ -431,12 +442,14 @@
}
catch (Exception e) {
SeamGenPlugin.logError( "Error while loading seamgen properties", e );
+ }
+ finally {
if(fileInputStream!=null)
try {
fileInputStream.close();
}
catch (IOException e1) {
- SeamGenPlugin.logError( "Error while closing seamgen properties", e );
+ SeamGenPlugin.logError( "Error while closing seamgen properties", e1 );
}
}
return p;