[ 
https://issues.apache.org/jira/browse/SLING-7289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282118#comment-16282118
 ] 

ASF GitHub Bot commented on SLING-7289:
---------------------------------------

kwin closed pull request #1: SLING-7289 remove validator from ValidatorMap
URL: https://github.com/apache/sling-org-apache-sling-validation-core/pull/1
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/main/java/org/apache/sling/validation/impl/ValidatorMap.java 
b/src/main/java/org/apache/sling/validation/impl/ValidatorMap.java
index 5c226aa..ae86e6a 100644
--- a/src/main/java/org/apache/sling/validation/impl/ValidatorMap.java
+++ b/src/main/java/org/apache/sling/validation/impl/ValidatorMap.java
@@ -222,6 +222,7 @@ public boolean remove(String id, 
ServiceReference<Validator<?>> serviceReference
         } else {
             // only actually remove if the service reference is equal
             if (entry.serviceReference.equals(serviceReference)) {
+                validatorMap.remove(id);
                 return true;
             } else {
                 LOG.warn("Could not remove validator with id '{}' from map 
because it is only contained with a different service reference!", id);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Sling Validator Service does not free Validators correctly
> ----------------------------------------------------------
>
>                 Key: SLING-7289
>                 URL: https://issues.apache.org/jira/browse/SLING-7289
>             Project: Sling
>          Issue Type: Bug
>          Components: Validation
>    Affects Versions: Validation 1.0.0
>            Reporter: Santiago GarcĂ­a Pimentel
>
> When a bundle that contains Sling Validators is removed. the Sling Validation 
> Service does not correctly free them.
> The problem is in the ValidatorMap, which fails to remove the service from 
> the map in 
> https://github.com/apache/sling-org-apache-sling-validation-core/blob/master/src/main/java/org/apache/sling/validation/impl/ValidatorMap.java#L225



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to