Skip to content

Commit

Permalink
Merge pull request #257 from apache/bugfix/255-File-handle-leak-acces…
Browse files Browse the repository at this point in the history
…sing-performanceTuning.properties

Issue #255: File handle leak accessing performanceTuning.properties (main)
  • Loading branch information
reckart authored Oct 14, 2022
2 parents c337dcb + f963e62 commit e9ef409
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.beans.Introspector;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -185,8 +186,10 @@ protected void _initialize() throws Exception {

// read performance tuning properties
mDefaultPerformanceTuningProperties = new Properties();
mDefaultPerformanceTuningProperties
.load(UIMAFramework_impl.class.getResourceAsStream("performanceTuning.properties"));
try (InputStream is = UIMAFramework_impl.class
.getResourceAsStream("performanceTuning.properties")) {
mDefaultPerformanceTuningProperties.load(is);
}

// create new HashMap for the LogWrappers
mLoggers = new ConcurrentHashMap<>(200, 1.0f);
Expand Down

0 comments on commit e9ef409

Please sign in to comment.