You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by an...@apache.org on 2022/09/28 12:59:48 UTC

[syncope] branch master updated: [SYNCOPE-1698] added check to avoid adding to the provision already p… (#377)

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

andreapatricelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f76fce39a [SYNCOPE-1698] added check to avoid adding to the provision already p… (#377)
5f76fce39a is described below

commit 5f76fce39abed1828128e27f7494a0628c66752d
Author: Andrea Patricelli <an...@apache.org>
AuthorDate: Wed Sep 28 14:59:42 2022 +0200

    [SYNCOPE-1698] added check to avoid adding to the provision already p… (#377)
    
    * [SYNCOPE-1698] added check to avoid adding to the provision already present aux classes
---
 .../syncope/core/provisioning/java/data/ResourceDataBinderImpl.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
index b86f460a3a..b079950ce3 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
@@ -166,8 +166,9 @@ public class ResourceDataBinderImpl implements ResourceDataBinder {
                 // add all classes contained in the TO
                 for (String name : provisionTO.getAuxClasses()) {
                     AnyTypeClass anyTypeClass = anyTypeClassDAO.find(name);
-                    if (anyTypeClass == null) {
-                        LOG.warn("Ignoring invalid {}: {}", AnyTypeClass.class.getSimpleName(), name);
+                    if (anyTypeClass == null || provision.getAuxClasses().contains(name)) {
+                        LOG.warn("Ignoring invalid or already present {}: {}", AnyTypeClass.class.getSimpleName(),
+                                name);
                     } else {
                         provision.getAuxClasses().add(anyTypeClass.getKey());
                     }