From 8ec36bc770a78f423f6c0d0c37b9efd7981815ed Mon Sep 17 00:00:00 2001 From: Rick Giles Date: Sat, 28 Dec 2002 12:19:26 +0000 Subject: [PATCH] improved error handling for illegal property values, e.g. 1. . Is it by accident or by design that bean properties like this cannot be set because they aren't "simple" types? 2. --- .../tools/checkstyle/api/AutomaticBean.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java index df574d8f6..f4bc95bd8 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java @@ -182,6 +182,17 @@ public class AutomaticBean implements Configurable, Contextualizable "cannot access " + key + " in " + this.getClass().getName()); } + catch (IllegalArgumentException e) { + throw new CheckstyleException( + "illegal value '" + value + "' for property '" + key + + "' of module " + aConfiguration.getName()); + } + catch (ConversionException e) { + throw new CheckstyleException( + "illegal value '" + value + "' for property '" + key + + "' of module " + aConfiguration.getName()); + } + } finishLocalSetup(); @@ -222,6 +233,16 @@ public class AutomaticBean implements Configurable, Contextualizable "cannot access " + key + " in " + this.getClass().getName()); } + catch (IllegalArgumentException e) { + throw new CheckstyleException( + "illegal value '" + value + "' for property '" + key + + "' of bean " + this.getClass().getName()); + } + catch (ConversionException e) { + throw new CheckstyleException( + "illegal value '" + value + "' for property '" + key + + "' of bean " + this.getClass().getName()); + } } }