This is an automated email from the ASF dual-hosted git repository. rec pushed a commit to branch bugfix/255-File-handle-leak-accessing-performanceTuning.properties in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git
commit fea3e5762ba70da6ab4f924279a80372a9d1ab9a Author: Richard Eckart de Castilho <[email protected]> AuthorDate: Fri Oct 14 09:39:39 2022 +0200 Issue #254: CPE worker threads should inherit TCCL from control thread - --- .../src/main/java/org/apache/uima/impl/UIMAFramework_impl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java b/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java index 3e72df30f..2058a41ae 100644 --- a/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java +++ b/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java @@ -21,6 +21,7 @@ package org.apache.uima.impl; 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; @@ -185,8 +186,10 @@ public class UIMAFramework_impl extends UIMAFramework { // 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);
