You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2022/03/30 09:05:12 UTC

[unomi] branch closeOpenResources created (now 241eeab)

This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a change to branch closeOpenResources
in repository https://gitbox.apache.org/repos/asf/unomi.git.


      at 241eeab  UNOMI-558: cleanup open resources

This branch includes the following new commits:

     new 241eeab  UNOMI-558: cleanup open resources

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[unomi] 01/01: UNOMI-558: cleanup open resources

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch closeOpenResources
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 241eeab62973a5cb4c6495e13e6ec4edb9a45942
Author: Kevan <ke...@jahia.com>
AuthorDate: Wed Mar 30 11:04:57 2022 +0200

    UNOMI-558: cleanup open resources
---
 .../persistence/elasticsearch/conditions/ConditionContextHelper.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java
index 211ed32..025566e 100644
--- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java
+++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java
@@ -131,9 +131,7 @@ public class ConditionContextHelper {
     public static String foldToASCII(String s) {
         if (s != null) {
             s = s.toLowerCase();
-            StringReader stringReader = new StringReader(s);
-            Reader foldedStringReader = mappingCharFilterFactory.create(stringReader);
-            try {
+            try (StringReader stringReader = new StringReader(s); Reader foldedStringReader = mappingCharFilterFactory.create(stringReader)) {
                 return IOUtils.toString(foldedStringReader);
             } catch (IOException e) {
                 logger.error("Error folding to ASCII string " + s, e);