From b3ac874100ac8ac2f6b0df47e39395d3ea88c1f8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Mon, 8 Jul 2013 17:43:10 +0200 Subject: [PATCH] SONAR-4466 Fixed quality issue --- .../server/permission/InternalPermissionTemplateService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java b/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java index 6afe026c32a..db518e31d63 100644 --- a/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java +++ b/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java @@ -144,7 +144,7 @@ public class InternalPermissionTemplateService implements ServerComponent { List existingTemplates = permissionDao.selectAllPermissionTemplates(); if(existingTemplates != null) { for (PermissionTemplateDto existingTemplate : existingTemplates) { - if((templateId == null || templateId != existingTemplate.getId()) && (existingTemplate.getName().equals(templateName))) { + if((templateId == null || !existingTemplate.getId().equals(templateId)) && (existingTemplate.getName().equals(templateName))) { String errorMsg = "A template with that name already exists"; LOG.error(errorMsg); throw new BadRequestException(errorMsg); -- 2.39.5