From 903f780d588932959740bcab31c45bb7da842eaa Mon Sep 17 00:00:00 2001 From: Oliver Burn Date: Wed, 6 Nov 2002 00:23:32 +0000 Subject: [PATCH] Added a getAbstractOption() method. I am going to change the design of this class to improve the following: - Not have protected member variables that are accessed directly. Checkstyle reports this error. - By default the mOption member is not initialised to a default value. This is causing strange behaviour in the EmptyBlockCheck when no option is specified, as it does nothing. It should default to statement. --- .../tools/checkstyle/checks/AbstractOptionCheck.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java index 2b4ee6458..2b8b6d862 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java @@ -44,4 +44,14 @@ public abstract class AbstractOptionCheck throw new ConversionException("unable to parse " + aOption); } } + + /** + * @return the AbstractOption set + */ + public AbstractOption getAbstractOption() + { + // WARNING!! Do not rename this method to getOption(). It breaks + // BeanUtils, which will silently not call setOption. Very annoying! + return mOption; + } }