copy array before returning it
thanks to Peter Dobratz for reporting this problem
This commit is contained in:
parent
784b327005
commit
632b1cd8cf
|
|
@ -35,24 +35,20 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
|||
* so their company's coding standards forbids them.
|
||||
*
|
||||
* @author lkuehne
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
public class AvoidInlineConditionalsCheck extends Check
|
||||
{
|
||||
/** avoids multiple instantiations of equivalten arrays */
|
||||
private static final int[] DEFAULT_TOKENS =
|
||||
new int[]{TokenTypes.QUESTION};
|
||||
|
||||
/** @see Check */
|
||||
public int[] getDefaultTokens()
|
||||
{
|
||||
return DEFAULT_TOKENS;
|
||||
return new int[]{TokenTypes.QUESTION};
|
||||
}
|
||||
|
||||
/** @see Check */
|
||||
public int[] getRequiredTokens()
|
||||
{
|
||||
return DEFAULT_TOKENS;
|
||||
return getDefaultTokens();
|
||||
}
|
||||
|
||||
/** @see Check */
|
||||
|
|
|
|||
|
|
@ -53,18 +53,14 @@ import com.puppycrawl.tools.checkstyle.api.ScopeUtils;
|
|||
* </p>
|
||||
*
|
||||
* @author lkuehne
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
public class DesignForInheritanceCheck extends Check
|
||||
{
|
||||
/** the default tokens for this check */
|
||||
private static final int[] DEFAULT_TOKENS =
|
||||
new int[] {TokenTypes.METHOD_DEF};
|
||||
|
||||
/** @see Check */
|
||||
public int[] getDefaultTokens()
|
||||
{
|
||||
return DEFAULT_TOKENS;
|
||||
return new int[] {TokenTypes.METHOD_DEF};
|
||||
}
|
||||
|
||||
/** @see Check */
|
||||
|
|
|
|||
Loading…
Reference in New Issue