From dev-return-15442-archive-asf-public=cust-asf.ponee.io@syncope.apache.org Thu Apr 12 16:16:44 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 54E0D180634 for ; Thu, 12 Apr 2018 16:16:44 +0200 (CEST) Received: (qmail 23618 invoked by uid 500); 12 Apr 2018 14:16:43 -0000 Mailing-List: contact dev-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list dev@syncope.apache.org Received: (qmail 23589 invoked by uid 99); 12 Apr 2018 14:16:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2018 14:16:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 44551E09E2; Thu, 12 Apr 2018 14:16:42 +0000 (UTC) From: ilgrosso To: dev@syncope.apache.org Reply-To: dev@syncope.apache.org References: In-Reply-To: Subject: [GitHub] syncope pull request #70: [SYNCOPE-1301] fixed Content-Type: text/plain Message-Id: <20180412141642.44551E09E2@git1-us-west.apache.org> Date: Thu, 12 Apr 2018 14:16:42 +0000 (UTC) Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/70#discussion_r181097338 --- Diff: core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java --- @@ -135,11 +135,7 @@ accessToken.setAuthorities(authorities); } - accessTokenDAO.save(accessToken); - } - - if (replaceExisting && existing != null) { - accessTokenDAO.delete(existing); + accessTokenDAO.merge(accessToken); --- End diff -- To me, it should be enough to pass the `replaceExisting` flag to the new `AccessTokenDAO#replace` method, and behave accordingly. ---