|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AbstractOptionCheck | Line # 29 | 80% |
0.8
|
4.13 | 5 | 4 | 4 | 0.8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ( 10 of 34) | |||
| Result | |||
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheckTest.test1322879
com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheckTest.test1322879
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheckTest.testOpWrapEOL
com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheckTest.testOpWrapEOL
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheckTest.testNL2
com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheckTest.testNL2
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheckTest.testSpaceOption
com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheckTest.testSpaceOption
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheckTest.test1322879
com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheckTest.test1322879
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheckTest.testNLOW
com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheckTest.testNLOW
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheckTest.testText
com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheckTest.testText
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheckTest.testSpace
com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheckTest.testSpace
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheckTest.testSpaceOption
com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheckTest.testSpaceOption
|
1 PASS | |
|
0.8
|
com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheckTest.testNL3
com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheckTest.testNL3
|
1 PASS | |
| 24 tests are not displayed. This report was configured to show the top 10 tests that covered this file. | |||
| 1 | //////////////////////////////////////////////////////////////////////////////// | |
| 2 | // checkstyle: Checks Java source code for adherence to a set of rules. | |
| 3 | // Copyright (C) 2001-2005 Oliver Burn | |
| 4 | // | |
| 5 | // This library is free software; you can redistribute it and/or | |
| 6 | // modify it under the terms of the GNU Lesser General Public | |
| 7 | // License as published by the Free Software Foundation; either | |
| 8 | // version 2.1 of the License, or (at your option) any later version. | |
| 9 | // | |
| 10 | // This library is distributed in the hope that it will be useful, | |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | // Lesser General Public License for more details. | |
| 14 | // | |
| 15 | // You should have received a copy of the GNU Lesser General Public | |
| 16 | // License along with this library; if not, write to the Free Software | |
| 17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 18 | //////////////////////////////////////////////////////////////////////////////// | |
| 19 | package com.puppycrawl.tools.checkstyle.checks; | |
| 20 | ||
| 21 | import org.apache.commons.beanutils.ConversionException; | |
| 22 | ||
| 23 | import com.puppycrawl.tools.checkstyle.api.Check; | |
| 24 | ||
| 25 | /** | |
| 26 | * Abstract class for checks with options. | |
| 27 | * @author Rick Giles | |
| 28 | */ | |
| 29 | public abstract class AbstractOptionCheck | |
| 30 | extends Check | |
| 31 | { | |
| 32 | /** the policy to enforce */ | |
| 33 | private AbstractOption mOption; | |
| 34 | ||
| 35 | /** | |
| 36 | * Creates a new <code>AbstractOptionCheck</code> instance. | |
| 37 | * @param aDefault the default option. | |
| 38 | */ | |
| 39 | 34 |
public AbstractOptionCheck(AbstractOption aDefault) |
| 40 | { | |
| 41 | 34 | mOption = aDefault; |
| 42 | } | |
| 43 | ||
| 44 | /** | |
| 45 | * Set the option to enforce. | |
| 46 | * @param aOption string to decode option from | |
| 47 | * @throws ConversionException if unable to decode | |
| 48 | */ | |
| 49 | 20 |
public void setOption(String aOption) |
| 50 | throws ConversionException | |
| 51 | { | |
| 52 | 20 | mOption = mOption.decode(aOption); |
| 53 | 20 | if (mOption == null) { |
| 54 | 0 | throw new ConversionException("unable to parse " + aOption); |
| 55 | } | |
| 56 | } | |
| 57 | ||
| 58 | /** | |
| 59 | * @return the <code>AbstractOption</code> set | |
| 60 | */ | |
| 61 | 964 |
public AbstractOption getAbstractOption() |
| 62 | { | |
| 63 | // WARNING!! Do not rename this method to getOption(). It breaks | |
| 64 | // BeanUtils, which will silently not call setOption. Very annoying! | |
| 65 | 964 | return mOption; |
| 66 | } | |
| 67 | } | |
|
|||||||||||||