This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-validator.git
The following commit(s) were added to refs/heads/master by this push: new faf8f6af Clean up Exceptions and formatting faf8f6af is described below commit faf8f6afdf5865250963ca711283fffc70b79344 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue May 16 15:06:10 2023 -0400 Clean up Exceptions and formatting --- src/main/java/org/apache/commons/validator/FormSetFactory.java | 8 ++++---- .../java/org/apache/commons/validator/ValidatorResources.java | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/validator/FormSetFactory.java b/src/main/java/org/apache/commons/validator/FormSetFactory.java index 763d62ba..de424757 100644 --- a/src/main/java/org/apache/commons/validator/FormSetFactory.java +++ b/src/main/java/org/apache/commons/validator/FormSetFactory.java @@ -42,11 +42,11 @@ public class FormSetFactory extends AbstractObjectCreationFactory { @Override public Object createObject(final Attributes attributes) throws Exception { - final ValidatorResources resources = (ValidatorResources)digester.peek(0); + final ValidatorResources resources = (ValidatorResources) digester.peek(0); final String language = attributes.getValue("language"); - final String country = attributes.getValue("country"); - final String variant = attributes.getValue("variant"); + final String country = attributes.getValue("country"); + final String variant = attributes.getValue("variant"); return createFormSet(resources, language, country, variant); @@ -66,7 +66,7 @@ public class FormSetFactory extends AbstractObjectCreationFactory { private FormSet createFormSet(final ValidatorResources resources, final String language, final String country, - final String variant) throws Exception { + final String variant) { // Retrieve existing FormSet for the language/country/variant FormSet formSet = resources.getFormSet(language, country, variant); diff --git a/src/main/java/org/apache/commons/validator/ValidatorResources.java b/src/main/java/org/apache/commons/validator/ValidatorResources.java index d18f2581..d6aba6f9 100644 --- a/src/main/java/org/apache/commons/validator/ValidatorResources.java +++ b/src/main/java/org/apache/commons/validator/ValidatorResources.java @@ -274,12 +274,10 @@ public class ValidatorResources implements Serializable { * working. */ private void addOldArgRules(final Digester digester) { - // Create a new rule to process args elements final Rule rule = new Rule() { @Override - public void begin(final String namespace, final String name, - final Attributes attributes) throws Exception { + public void begin(final String namespace, final String name, final Attributes attributes) { // Create the Arg final Arg arg = new Arg(); arg.setKey(attributes.getValue("key")); @@ -291,12 +289,11 @@ public class ValidatorResources implements Serializable { final int length = "arg".length(); // skip the arg prefix arg.setPosition(Integer.parseInt(name.substring(length))); } catch (final Exception ex) { - getLog().error("Error parsing Arg position: " - + name + " " + arg + " " + ex); + getLog().error("Error parsing Arg position: " + name + " " + arg + " " + ex); } // Add the arg to the parent field - ((Field)getDigester().peek(0)).addArg(arg); + ((Field) getDigester().peek(0)).addArg(arg); } };