Indentation:
fix for indentation problems found be Indentation check. Indentation check added to checkstyle_checkstyle.xml with "warning" severity.
This commit is contained in:
parent
2f98a4aa29
commit
f0edd3eaf1
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
<!-- set global properties for this build -->
|
||||
|
||||
<!-- TODO: this property should be removed as soon as possible -->
|
||||
<property name="indent.severity" value="warning"/>
|
||||
|
||||
<!-- Give user a chance to override without editing this file -->
|
||||
<!-- (and without typing -D each time it compiles it) -->
|
||||
<property file="checkstyle.buildproperties" />
|
||||
|
|
|
|||
|
|
@ -107,5 +107,13 @@
|
|||
<module name="FinalClass"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="MagicNumber"/>
|
||||
<module name="Indentation">
|
||||
<!-- TODO: this property should be removed as soon as possible -->
|
||||
<!-- from here and build.xml -->
|
||||
<property name="severity" value="${indent.severity}"/>
|
||||
<property name="basicOffset" value="4"/>
|
||||
<property name="braceAdjustment" value="0"/>
|
||||
<property name="caseIndent" value="0"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public class Checker extends AutomaticBean
|
|||
|
||||
/** @see AutomaticBean */
|
||||
public void finishLocalSetup()
|
||||
throws CheckstyleException
|
||||
throws CheckstyleException
|
||||
{
|
||||
final Locale locale = new Locale(mLocaleLanguage, mLocaleCountry);
|
||||
LocalizedMessage.setLocale(locale);
|
||||
|
|
@ -169,7 +169,7 @@ public class Checker extends AutomaticBean
|
|||
* @see com.puppycrawl.tools.checkstyle.api.AutomaticBean
|
||||
*/
|
||||
protected void setupChild(Configuration aChildConf)
|
||||
throws CheckstyleException
|
||||
throws CheckstyleException
|
||||
{
|
||||
final String name = aChildConf.getName();
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public final class ConfigurationLoader
|
|||
String aLocalName,
|
||||
String aQName,
|
||||
Attributes aAtts)
|
||||
throws SAXException
|
||||
throws SAXException
|
||||
{
|
||||
// TODO: debug logging for support puposes
|
||||
if (aQName.equals(MODULE)) {
|
||||
|
|
@ -266,9 +266,8 @@ public final class ConfigurationLoader
|
|||
* Code copied from ant -
|
||||
* http://cvs.apache.org/viewcvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
|
||||
*/
|
||||
static String replaceProperties(
|
||||
String aValue, PropertyResolver aProps)
|
||||
throws CheckstyleException
|
||||
static String replaceProperties(String aValue, PropertyResolver aProps)
|
||||
throws CheckstyleException
|
||||
{
|
||||
if (aValue == null) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public final class PackageNamesLoader
|
|||
String aLocalName,
|
||||
String aQName,
|
||||
Attributes aAtts)
|
||||
throws SAXException
|
||||
throws SAXException
|
||||
{
|
||||
if (aQName.equals("package")) {
|
||||
//push package name
|
||||
|
|
@ -88,7 +88,7 @@ public final class PackageNamesLoader
|
|||
}
|
||||
mPackageStack.push(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a full package name from the package names on the stack.
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ public final class TreeWalker
|
|||
* @see com.puppycrawl.tools.checkstyle.api.AutomaticBean
|
||||
*/
|
||||
public void setupChild(Configuration aChildConf)
|
||||
throws CheckstyleException
|
||||
throws CheckstyleException
|
||||
{
|
||||
// TODO: improve the error handing
|
||||
final String name = aChildConf.getName();
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ public class AutomaticBean
|
|||
* @see Contextualizable
|
||||
*/
|
||||
public final void contextualize(Context aContext)
|
||||
throws CheckstyleException
|
||||
throws CheckstyleException
|
||||
{
|
||||
// TODO: debug log messages
|
||||
final String[] attributes = aContext.getAttributeNames();
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public class EmptyBlockCheck
|
|||
final String txt = lines[slistLineNo - 1]
|
||||
.substring(slistColNo + 1, rcurlyColNo);
|
||||
if (txt.trim().length() != 0) {
|
||||
retVal = true;
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
|||
*/
|
||||
public class EmptyStatementCheck extends Check
|
||||
{
|
||||
/** @see com.puppycrawl.tools.checkstyle.api.Check */
|
||||
public int[] getDefaultTokens()
|
||||
{
|
||||
return new int[] {TokenTypes.EMPTY_STAT};
|
||||
}
|
||||
/** @see com.puppycrawl.tools.checkstyle.api.Check */
|
||||
public int[] getDefaultTokens()
|
||||
{
|
||||
return new int[] {TokenTypes.EMPTY_STAT};
|
||||
}
|
||||
|
||||
/** @see com.puppycrawl.tools.checkstyle.api.Check */
|
||||
public void visitToken(DetailAST aAST)
|
||||
{
|
||||
log(aAST.getLineNo(), aAST.getColumnNo(), "empty.statement");
|
||||
}
|
||||
/** @see com.puppycrawl.tools.checkstyle.api.Check */
|
||||
public void visitToken(DetailAST aAST)
|
||||
{
|
||||
log(aAST.getLineNo(), aAST.getColumnNo(), "empty.statement");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public class EqualsHashCodeCheck
|
|||
&& modifiers.branchContains(TokenTypes.LITERAL_PUBLIC)
|
||||
&& parameters.getChildCount() == 1
|
||||
&& isObjectParam(parameters.getFirstChild())
|
||||
)
|
||||
)
|
||||
{
|
||||
mObjBlockEquals.put(aAST.getParent(), aAST);
|
||||
}
|
||||
|
|
@ -112,17 +112,17 @@ public class EqualsHashCodeCheck
|
|||
final AST modifiers = aFirstChild.getFirstChild();
|
||||
AST type = modifiers.getNextSibling();
|
||||
switch (type.getFirstChild().getType()) {
|
||||
case TokenTypes.LITERAL_BOOLEAN:
|
||||
case TokenTypes.LITERAL_BYTE:
|
||||
case TokenTypes.LITERAL_CHAR:
|
||||
case TokenTypes.LITERAL_DOUBLE:
|
||||
case TokenTypes.LITERAL_FLOAT:
|
||||
case TokenTypes.LITERAL_INT:
|
||||
case TokenTypes.LITERAL_LONG:
|
||||
case TokenTypes.LITERAL_SHORT:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
case TokenTypes.LITERAL_BOOLEAN:
|
||||
case TokenTypes.LITERAL_BYTE:
|
||||
case TokenTypes.LITERAL_CHAR:
|
||||
case TokenTypes.LITERAL_DOUBLE:
|
||||
case TokenTypes.LITERAL_FLOAT:
|
||||
case TokenTypes.LITERAL_INT:
|
||||
case TokenTypes.LITERAL_LONG:
|
||||
case TokenTypes.LITERAL_SHORT:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,4 +150,4 @@ public class HiddenFieldCheck
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,17 +114,17 @@ public class IllegalInstantiationCheck
|
|||
public void visitToken(DetailAST aAST)
|
||||
{
|
||||
switch (aAST.getType()) {
|
||||
case TokenTypes.LITERAL_NEW:
|
||||
processLiteralNew(aAST);
|
||||
break;
|
||||
case TokenTypes.PACKAGE_DEF:
|
||||
processPackageDef(aAST);
|
||||
break;
|
||||
case TokenTypes.IMPORT:
|
||||
processImport(aAST);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown type " + aAST);
|
||||
case TokenTypes.LITERAL_NEW:
|
||||
processLiteralNew(aAST);
|
||||
break;
|
||||
case TokenTypes.PACKAGE_DEF:
|
||||
processPackageDef(aAST);
|
||||
break;
|
||||
case TokenTypes.IMPORT:
|
||||
processImport(aAST);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown type " + aAST);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,48 +119,48 @@ public class LeftCurlyCheck
|
|||
final DetailAST brace;
|
||||
|
||||
switch (aAST.getType()) {
|
||||
case TokenTypes.CTOR_DEF :
|
||||
case TokenTypes.METHOD_DEF :
|
||||
startToken = aAST;
|
||||
brace = aAST.findFirstToken(TokenTypes.SLIST);
|
||||
break;
|
||||
case TokenTypes.CTOR_DEF :
|
||||
case TokenTypes.METHOD_DEF :
|
||||
startToken = aAST;
|
||||
brace = aAST.findFirstToken(TokenTypes.SLIST);
|
||||
break;
|
||||
|
||||
case TokenTypes.INTERFACE_DEF :
|
||||
case TokenTypes.CLASS_DEF :
|
||||
// TODO: should check for modifiers
|
||||
startToken = (DetailAST) aAST.getFirstChild().getNextSibling();
|
||||
brace = (DetailAST) aAST.getLastChild().getFirstChild();
|
||||
break;
|
||||
case TokenTypes.INTERFACE_DEF :
|
||||
case TokenTypes.CLASS_DEF :
|
||||
// TODO: should check for modifiers
|
||||
startToken = (DetailAST) aAST.getFirstChild().getNextSibling();
|
||||
brace = (DetailAST) aAST.getLastChild().getFirstChild();
|
||||
break;
|
||||
|
||||
case TokenTypes.LITERAL_WHILE:
|
||||
case TokenTypes.LITERAL_CATCH:
|
||||
case TokenTypes.LITERAL_SYNCHRONIZED:
|
||||
case TokenTypes.LITERAL_FOR:
|
||||
case TokenTypes.LITERAL_TRY:
|
||||
case TokenTypes.LITERAL_FINALLY:
|
||||
case TokenTypes.LITERAL_DO:
|
||||
case TokenTypes.LITERAL_IF :
|
||||
startToken = aAST;
|
||||
brace = aAST.findFirstToken(TokenTypes.SLIST);
|
||||
break;
|
||||
case TokenTypes.LITERAL_WHILE:
|
||||
case TokenTypes.LITERAL_CATCH:
|
||||
case TokenTypes.LITERAL_SYNCHRONIZED:
|
||||
case TokenTypes.LITERAL_FOR:
|
||||
case TokenTypes.LITERAL_TRY:
|
||||
case TokenTypes.LITERAL_FINALLY:
|
||||
case TokenTypes.LITERAL_DO:
|
||||
case TokenTypes.LITERAL_IF :
|
||||
startToken = aAST;
|
||||
brace = aAST.findFirstToken(TokenTypes.SLIST);
|
||||
break;
|
||||
|
||||
case TokenTypes.LITERAL_ELSE :
|
||||
startToken = aAST;
|
||||
final DetailAST candidate = (DetailAST) aAST.getFirstChild();
|
||||
brace =
|
||||
(candidate.getType() == TokenTypes.SLIST)
|
||||
? candidate
|
||||
: null; // silently ignore
|
||||
break;
|
||||
case TokenTypes.LITERAL_ELSE :
|
||||
startToken = aAST;
|
||||
final DetailAST candidate = (DetailAST) aAST.getFirstChild();
|
||||
brace =
|
||||
(candidate.getType() == TokenTypes.SLIST)
|
||||
? candidate
|
||||
: null; // silently ignore
|
||||
break;
|
||||
|
||||
case TokenTypes.LITERAL_SWITCH :
|
||||
startToken = aAST;
|
||||
brace = aAST.findFirstToken(TokenTypes.LCURLY);
|
||||
break;
|
||||
case TokenTypes.LITERAL_SWITCH :
|
||||
startToken = aAST;
|
||||
brace = aAST.findFirstToken(TokenTypes.LCURLY);
|
||||
break;
|
||||
|
||||
default :
|
||||
startToken = null;
|
||||
brace = null;
|
||||
default :
|
||||
startToken = null;
|
||||
brace = null;
|
||||
}
|
||||
|
||||
if ((brace != null) && (startToken != null)) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class LineSeparatorOption extends AbstractOption
|
|||
|
||||
/** Windows-style line separators **/
|
||||
public static final LineSeparatorOption CRLF =
|
||||
new LineSeparatorOption("crlf", "\r\n");
|
||||
new LineSeparatorOption("crlf", "\r\n");
|
||||
|
||||
/** Mac-style line separators **/
|
||||
public static final LineSeparatorOption CR =
|
||||
|
|
|
|||
|
|
@ -68,16 +68,16 @@ public class SimplifyBooleanExpressionCheck
|
|||
{
|
||||
final DetailAST parent = aAST.getParent();
|
||||
switch (parent.getType()) {
|
||||
case TokenTypes.NOT_EQUAL:
|
||||
case TokenTypes.EQUAL:
|
||||
case TokenTypes.LNOT:
|
||||
case TokenTypes.LOR:
|
||||
case TokenTypes.LAND:
|
||||
log(parent.getLineNo(), parent.getColumnNo(),
|
||||
"simplify.expression");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case TokenTypes.NOT_EQUAL:
|
||||
case TokenTypes.EQUAL:
|
||||
case TokenTypes.LNOT:
|
||||
case TokenTypes.LOR:
|
||||
case TokenTypes.LAND:
|
||||
log(parent.getLineNo(), parent.getColumnNo(),
|
||||
"simplify.expression");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,12 +186,12 @@ public class VisibilityModifierCheck
|
|||
DetailAST ast = aAST.getParent();
|
||||
while (ast != null) {
|
||||
switch (ast.getType()) {
|
||||
case TokenTypes.INTERFACE_DEF:
|
||||
return true;
|
||||
case TokenTypes.CLASS_DEF:
|
||||
return false;
|
||||
default:
|
||||
ast = ast.getParent();
|
||||
case TokenTypes.INTERFACE_DEF:
|
||||
return true;
|
||||
case TokenTypes.CLASS_DEF:
|
||||
return false;
|
||||
default:
|
||||
ast = ast.getParent();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue