Minor syntax. I really like this check as I used to use the idiom. BTW, I

think an input test file has not been added to CVS as the unit test fails.
This commit is contained in:
Oliver Burn 2003-03-30 02:38:42 +00:00
parent 3e5a642f7c
commit b0902e01cc
1 changed files with 6 additions and 6 deletions

View File

@ -30,8 +30,8 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
*
* See <a href=
* "http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html"
* >The &quot;Double-Checked Locking is Broken&quot; Declaration</a>
* for a more in depth explanation.
* >The &quot;Double-Checked Locking is Broken&quot; Declaration</a> for a
* more in depth explanation.
*
* @author Lars K&uuml;hne
*/
@ -46,13 +46,13 @@ public class DoubleCheckedLockingCheck extends Check
/** @see Check */
public void visitToken(DetailAST aAST)
{
DetailAST synchronizedAST =
final DetailAST synchronizedAST =
getLowestParent(aAST, TokenTypes.LITERAL_SYNCHRONIZED);
if (synchronizedAST == null) {
return;
}
DetailAST ifAST =
final DetailAST ifAST =
getLowestParent(synchronizedAST, TokenTypes.LITERAL_IF);
if (ifAST == null) {
return;
@ -83,8 +83,8 @@ public class DoubleCheckedLockingCheck extends Check
private DetailAST getLowestParent(DetailAST aAST, int aTokenType)
{
DetailAST synchronizedParent = aAST;
while (synchronizedParent != null
&& synchronizedParent.getType() != aTokenType)
while ((synchronizedParent != null)
&& (synchronizedParent.getType() != aTokenType))
{
synchronizedParent = synchronizedParent.getParent();
}