You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2021/10/28 16:29:35 UTC

[uima-uimafit] branch bugfix/UIMA-6385-Potential-resource-key-clash-in-environments-with-multiple-classloaders created (now 7ec91f0)

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

rec pushed a change to branch bugfix/UIMA-6385-Potential-resource-key-clash-in-environments-with-multiple-classloaders
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git.


      at 7ec91f0  [UIMA-6385] Potential resource key clash in environments with multiple classloaders

This branch includes the following new commits:

     new 7ec91f0  [UIMA-6385] Potential resource key clash in environments with multiple classloaders

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.


[uima-uimafit] 01/01: [UIMA-6385] Potential resource key clash in environments with multiple classloaders

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

rec pushed a commit to branch bugfix/UIMA-6385-Potential-resource-key-clash-in-environments-with-multiple-classloaders
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git

commit 7ec91f06938e5e578777db795ef56c1e3a29a8ed
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Thu Oct 28 18:29:20 2021 +0200

    [UIMA-6385] Potential resource key clash in environments with multiple classloaders
    
    - Disambiguate the static disambiguator via its identity hash code (which should by unique for the entire JVM when there are multiple static disambiguators in different classloaders for some reason)
---
 .../main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java b/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
index 20b1f5c..fa98531 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
@@ -19,6 +19,7 @@
 
 package org.apache.uima.fit.factory;
 
+import static java.lang.System.identityHashCode;
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyMap;
 import static org.apache.uima.UIMAFramework.getResourceSpecifierFactory;
@@ -1303,7 +1304,7 @@ public final class ExternalResourceFactory {
   }
 
   static String uniqueResourceKey(String aKey) {
-    return aKey + '-' + DISAMBIGUATOR.getAndIncrement();
+    return aKey + '-' + identityHashCode(DISAMBIGUATOR) + '-' + DISAMBIGUATOR.getAndIncrement();
   }
 
   /**