From c9bcfe0be081433adaa7f8db0882d4f78246c646 Mon Sep 17 00:00:00 2001 From: Oliver Burn Date: Wed, 6 Nov 2002 00:18:46 +0000 Subject: [PATCH] Fixed checkstyle errors - could we all now get into the habit of running "checkstyle.checkstyle" before committing. --- .../tools/checkstyle/CheckStyleTask.java | 1 + .../tools/checkstyle/StringArrayReader.java | 5 ++++- .../com/puppycrawl/tools/checkstyle/Verifier.java | 15 ++++++--------- .../puppycrawl/tools/checkstyle/api/Check.java | 6 ++++-- .../tools/checkstyle/checks/BlockOption.java | 7 ++++++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java index 8cbf4bdfd..077b4e21d 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java @@ -152,6 +152,7 @@ public class CheckStyleTask mFileName = aFile.getAbsolutePath(); } + /** @param aFile the configuration file to use */ public void setConfig(File aFile) { mConfigFile = aFile; diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/StringArrayReader.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/StringArrayReader.java index 492e04d3e..87b6645c0 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/StringArrayReader.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/StringArrayReader.java @@ -131,7 +131,10 @@ class StringArrayReader extends Reader } } - /** Throws an IOException if the reader has already been closed. */ + /** + * Throws an IOException if the reader has already been closed. + * @throws IOException if the stream has been closed + */ private void ensureOpen() throws IOException { if (mClosed) { diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java index 38ecc45df..f944c7065 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java @@ -18,21 +18,18 @@ //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle; -import com.puppycrawl.tools.checkstyle.api.LocalizedMessage; -import com.puppycrawl.tools.checkstyle.api.LocalizedMessages; -import com.puppycrawl.tools.checkstyle.api.Utils; -import org.apache.regexp.RE; - -import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; import java.util.Map; import java.util.Set; import java.util.Stack; +import org.apache.regexp.RE; + +import com.puppycrawl.tools.checkstyle.api.LocalizedMessage; +import com.puppycrawl.tools.checkstyle.api.LocalizedMessages; +import com.puppycrawl.tools.checkstyle.api.Utils; + /** * Verifier of Java rules. Each rule verifier takes the form of * void verifyXXX(args). The implementation must not throw any diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/Check.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/Check.java index 75045fa03..1ca3e777d 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/Check.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/Check.java @@ -286,7 +286,8 @@ public abstract class Check * @param aArg0 first argument * @param aArg1 second argument */ - protected final void log(int aLineNo, String aKey, Object aArg0, Object aArg1) + protected final void log(int aLineNo, String aKey, + Object aArg0, Object aArg1) { log(aLineNo, aKey, new Object[] {aArg0, aArg1}); } @@ -356,7 +357,8 @@ public abstract class Check * @param aKey key to locale message format * @param aArgs arguments for message */ - protected final void log(int aLineNo, int aColNo, String aKey, Object[] aArgs) + protected final void log(int aLineNo, int aColNo, + String aKey, Object[] aArgs) { final int col = 1 + Utils.lengthExpandedTabs( getLines()[aLineNo - 1], aColNo, getTabWidth()); diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/BlockOption.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/BlockOption.java index 0af1beafa..ec236e7e9 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/BlockOption.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/BlockOption.java @@ -26,11 +26,16 @@ package com.puppycrawl.tools.checkstyle.checks; public final class BlockOption extends AbstractOption { + /** + * Creates a new BlockOption instance. + * + * @param aStrRep the string representation + */ private BlockOption(String aStrRep) { super(aStrRep); } - + /** require that there is some text in the block **/ public static final BlockOption TEXT = new BlockOption("text"); /** require that there is a statement in the block **/