소스 검색

SEC-2690: Add guard around debug statement

Rob Winch 11 년 전
부모
커밋
4a633a938a
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java

+ 3 - 1
ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java

@@ -249,7 +249,9 @@ public class SpringSecurityLdapTemplate extends LdapTemplate {
     private void extractStringAttributeValues(DirContextAdapter adapter, Map<String, List<String>> record, String attributeName) {
         Object[] values = adapter.getObjectAttributes(attributeName);
         if (values == null || values.length == 0) {
-            logger.debug("No attribute value found for '" + attributeName + "'");
+            if(logger.isDebugEnabled()) {
+                logger.debug("No attribute value found for '" + attributeName + "'");
+            }
             return;
         }
         List<String> svalues = new ArrayList<String>();