bug-750348: removed broken support for checking typecasts
This commit is contained in:
parent
33b86f5b25
commit
75a289111e
|
|
@ -461,9 +461,7 @@
|
|||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RPAREN">RPAREN</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a></td>
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>
|
||||
|
||||
<td><a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_CALL">CTOR_CALL</a>,
|
||||
|
|
@ -474,9 +472,7 @@
|
|||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RPAREN">RPAREN</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>,
|
||||
<a
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a></td>
|
||||
href="api/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@
|
|||
|
||||
<li class="body">NumberFormatException in MagicNumberCheck (bug 748913)</li>
|
||||
|
||||
<li class="body">Removed broken support for checking typecasts from
|
||||
ParenPadCheck (bug 750348)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import com.puppycrawl.tools.checkstyle.checks.AbstractOptionCheck;
|
|||
* {@link TokenTypes#METHOD_CALL METHOD_CALL},
|
||||
* {@link TokenTypes#RPAREN RPAREN},
|
||||
* {@link TokenTypes#SUPER_CTOR_CALL SUPER_CTOR_CALL},
|
||||
* {@link TokenTypes#TYPECAST TYPECAST}.
|
||||
* </p>
|
||||
* <p>
|
||||
* An example of how to configure the check is:
|
||||
|
|
@ -83,7 +82,6 @@ public class ParenPadCheck
|
|||
TokenTypes.LPAREN,
|
||||
TokenTypes.CTOR_CALL,
|
||||
TokenTypes.SUPER_CTOR_CALL,
|
||||
TokenTypes.TYPECAST, // TODO: treat this?
|
||||
TokenTypes.METHOD_CALL,
|
||||
};
|
||||
}
|
||||
|
|
@ -91,12 +89,16 @@ public class ParenPadCheck
|
|||
/** @see com.puppycrawl.tools.checkstyle.api.Check */
|
||||
public void visitToken(DetailAST aAST)
|
||||
{
|
||||
if (aAST.getType() == TokenTypes.RPAREN) {
|
||||
processRight(aAST);
|
||||
}
|
||||
else {
|
||||
// Strange logic in this method to guard against checking RPAREN tokens
|
||||
// that are associated with a TYPECAST token.
|
||||
if (aAST.getType() != TokenTypes.RPAREN) {
|
||||
processLeft(aAST);
|
||||
}
|
||||
else if ((aAST.getParent() == null)
|
||||
|| (aAST.getParent().getType() != TokenTypes.TYPECAST))
|
||||
{
|
||||
processRight(aAST);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue