File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/java/org/apache/ibatis/migration/commands
test/java/org/apache/ibatis/migration Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -276,13 +276,23 @@ private void lazyInitializeDrivers() {
276
276
}
277
277
278
278
protected Properties environmentProperties () {
279
+ FileInputStream fileInputStream = null ;
279
280
try {
280
281
File file = existingEnvironmentFile ();
281
282
Properties props = new Properties ();
282
- props .load (new FileInputStream (file ));
283
+ fileInputStream = new FileInputStream (file );
284
+ props .load (fileInputStream );
283
285
return props ;
284
286
} catch (IOException e ) {
285
287
throw new MigrationException ("Error loading environment properties. Cause: " + e , e );
288
+ } finally {
289
+ if (fileInputStream != null ) {
290
+ try {
291
+ fileInputStream .close ();
292
+ } catch (IOException e ) {
293
+ //Nothing to do here
294
+ }
295
+ }
286
296
}
287
297
}
288
298
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ public void write(int b) throws IOException {
194
194
// out.write(b);
195
195
}
196
196
197
+ @ Override
197
198
public String toString () {
198
199
return builder .toString ();
199
200
}
You can’t perform that action at this time.
0 commit comments