From e14e0f82112d141a2a99d4fcb7515df17052dc21 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Tue, 9 May 2023 16:34:53 -0600 Subject: [PATCH] Address JavaFormat Violations in Ldif Tests Issue gh-743 --- .../DefaultAttributeValidationPolicyTests.java | 7 ++++--- .../ldap/ldif/LdifParserTests.java | 18 +++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/DefaultAttributeValidationPolicyTests.java b/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/DefaultAttributeValidationPolicyTests.java index ab37b906..681816fe 100644 --- a/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/DefaultAttributeValidationPolicyTests.java +++ b/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/DefaultAttributeValidationPolicyTests.java @@ -201,9 +201,10 @@ public class DefaultAttributeValidationPolicyTests { log.info("Success!"); } - catch (Exception e) { - if (!this.exceptions.contains(this.line)) - fail("Exception thrown: " + e.getClass().getSimpleName() + " (message: " + e.getMessage() + ")"); + catch (Exception ex) { + if (!this.exceptions.contains(this.line)) { + fail("Exception thrown: " + ex.getClass().getSimpleName() + " (message: " + ex.getMessage() + ")"); + } } } diff --git a/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/LdifParserTests.java b/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/LdifParserTests.java index 12d939b3..464ee1ac 100644 --- a/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/LdifParserTests.java +++ b/ldif/ldif-core/src/test/java/org/springframework/ldap/ldif/LdifParserTests.java @@ -71,8 +71,8 @@ public class LdifParserTests { try { this.parser.open(); } - catch (IOException e) { - fail(e.getMessage()); + catch (IOException ex) { + fail(ex.getMessage()); } } @@ -97,10 +97,10 @@ public class LdifParserTests { count++; } } - catch (InvalidAttributeFormatException e) { - log.error("Invalid attribute", e); + catch (InvalidAttributeFormatException ex) { + log.error("Invalid attribute", ex); if (count != 6) { - fail(e.getMessage()); + fail(ex.getMessage()); } } @@ -114,8 +114,8 @@ public class LdifParserTests { log.info("Done!"); } - catch (IOException e) { - fail(e.getMessage()); + catch (IOException ex) { + fail(ex.getMessage()); } } @@ -127,8 +127,8 @@ public class LdifParserTests { try { this.parser.close(); } - catch (IOException e) { - fail(e.getMessage()); + catch (IOException ex) { + fail(ex.getMessage()); } }