From: Jean-Baptiste Vilain Date: Mon, 8 Jul 2013 15:43:10 +0000 (+0200) Subject: SONAR-4466 Fixed quality issue X-Git-Tag: 3.7~207 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b3ac874100ac8ac2f6b0df47e39395d3ea88c1f8;p=sonarqube.git SONAR-4466 Fixed quality issue --- 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);