aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorrnveach <rveach02@gmail.com>2016-04-23 13:43:57 -0400
committerrnveach <rveach02@gmail.com>2016-05-07 12:41:13 -0400
commit871b20e88b5bfedb324f3e1996b37d0c68eb727b (patch)
tree1d803c48d8b1440bda25b5752e2aac2b5a2f1c47 /src/main
parent9e9a0b424551418e80c5a7e7badadfe80958ec82 (diff)
downloadcheckstyle-871b20e88b5bfedb324f3e1996b37d0c68eb727b.tar.gz
Issue #2763: changed config and fixed throws indentation violations
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/Checker.java2
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java18
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java2
-rwxr-xr-xsrc/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java6
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java2
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java8
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java6
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java2
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java2
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java4
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java8
11 files changed, 30 insertions, 30 deletions
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java
index 221137214..76f27b1ba 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java
@@ -521,7 +521,7 @@ public class Checker extends AutomaticBean implements MessageDispatcher {
* @throws UnsupportedEncodingException if charset is unsupported.
*/
public void setCharset(String charset)
- throws UnsupportedEncodingException {
+ throws UnsupportedEncodingException {
if (!Charset.isSupported(charset)) {
final String message = "unsupported charset: '" + charset + "'";
throw new UnsupportedEncodingException(message);
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java
index d86f12177..d4fdc7d50 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java
@@ -118,7 +118,7 @@ public final class ConfigurationLoader {
*/
private ConfigurationLoader(final PropertyResolver overrideProps,
final boolean omitIgnoredModules)
- throws ParserConfigurationException, SAXException {
+ throws ParserConfigurationException, SAXException {
saxHandler = new InternalLoader();
overridePropsResolver = overrideProps;
this.omitIgnoredModules = omitIgnoredModules;
@@ -148,7 +148,7 @@ public final class ConfigurationLoader {
* @throws SAXException if an error occurs
*/
private void parseInputSource(InputSource source)
- throws IOException, SAXException {
+ throws IOException, SAXException {
saxHandler.parseInputSource(source);
}
@@ -176,7 +176,7 @@ public final class ConfigurationLoader {
*/
public static Configuration loadConfiguration(String config,
PropertyResolver overridePropsResolver, boolean omitIgnoredModules)
- throws CheckstyleException {
+ throws CheckstyleException {
// figure out if this is a File or a URL
final URI uri = CommonUtils.getUriByFilename(config);
final InputSource source = new InputSource(uri.toString());
@@ -204,7 +204,7 @@ public final class ConfigurationLoader {
@Deprecated
public static Configuration loadConfiguration(InputStream configStream,
PropertyResolver overridePropsResolver, boolean omitIgnoredModules)
- throws CheckstyleException {
+ throws CheckstyleException {
return loadConfiguration(new InputSource(configStream),
overridePropsResolver, omitIgnoredModules);
}
@@ -223,7 +223,7 @@ public final class ConfigurationLoader {
*/
public static Configuration loadConfiguration(InputSource configSource,
PropertyResolver overridePropsResolver, boolean omitIgnoredModules)
- throws CheckstyleException {
+ throws CheckstyleException {
try {
final ConfigurationLoader loader =
new ConfigurationLoader(overridePropsResolver,
@@ -265,7 +265,7 @@ public final class ConfigurationLoader {
*/
private static String replaceProperties(
String value, PropertyResolver props, String defaultValue)
- throws CheckstyleException {
+ throws CheckstyleException {
if (value == null) {
return null;
}
@@ -319,7 +319,7 @@ public final class ConfigurationLoader {
private static void parsePropertyString(String value,
List<String> fragments,
List<String> propertyRefs)
- throws CheckstyleException {
+ throws CheckstyleException {
int prev = 0;
//search for the next instance of $ from the 'prev' position
int pos = value.indexOf(DOLLAR_SIGN, prev);
@@ -401,7 +401,7 @@ public final class ConfigurationLoader {
* @throws ParserConfigurationException if an error occurs
*/
InternalLoader()
- throws SAXException, ParserConfigurationException {
+ throws SAXException, ParserConfigurationException {
super(createIdToResourceNameMap());
}
@@ -410,7 +410,7 @@ public final class ConfigurationLoader {
String localName,
String qName,
Attributes attributes)
- throws SAXException {
+ throws SAXException {
if (qName.equals(MODULE)) {
//create configuration
final String name = attributes.getValue(NAME);
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java
index 9043f5b06..e66e4911b 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java
@@ -76,7 +76,7 @@ public final class PackageNamesLoader
* @throws SAXException if an error occurs
*/
private PackageNamesLoader()
- throws ParserConfigurationException, SAXException {
+ throws ParserConfigurationException, SAXException {
super(DTD_PUBLIC_ID, DTD_RESOURCE_NAME);
}
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java
index 54cc0aeef..6187b2a7d 100755
--- a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java
@@ -147,7 +147,7 @@ public final class TreeWalker
@Override
public void setupChild(Configuration childConf)
- throws CheckstyleException {
+ throws CheckstyleException {
final String name = childConf.getName();
final Object module = moduleFactory.createModule(name);
if (!(module instanceof AbstractCheck)) {
@@ -202,7 +202,7 @@ public final class TreeWalker
* @throws CheckstyleException if an error occurs
*/
private void registerCheck(AbstractCheck check)
- throws CheckstyleException {
+ throws CheckstyleException {
validateDefaultTokens(check);
final int[] tokens;
final Set<String> checkTokens = check.getTokenNames();
@@ -419,7 +419,7 @@ public final class TreeWalker
* if parsing failed
*/
public static DetailAST parse(FileContents contents)
- throws RecognitionException, TokenStreamException {
+ throws RecognitionException, TokenStreamException {
final String fullText = contents.getText().getFullText().toString();
final Reader reader = new StringReader(fullText);
final GeneratedJavaLexer lexer = new GeneratedJavaLexer(reader);
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java b/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java
index e84187b06..0478dacf7 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java
@@ -600,7 +600,7 @@ public class CheckstyleAntTask extends Task {
* @throws IOException if an error occurs
*/
private AuditListener createDefaultLogger(Task task)
- throws IOException {
+ throws IOException {
if (toFile == null || !useFile) {
return new DefaultLogger(
new LogOutputStream(task, Project.MSG_DEBUG),
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java
index 2e60e6d65..75ed6d639 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java
@@ -64,7 +64,7 @@ public abstract class AbstractLoader
* @throws ParserConfigurationException if an error occurs
*/
protected AbstractLoader(String publicId, String dtdResourceName)
- throws SAXException, ParserConfigurationException {
+ throws SAXException, ParserConfigurationException {
this(new HashMap<String, String>(1));
publicIdToResourceNameMap.put(publicId, dtdResourceName);
}
@@ -76,7 +76,7 @@ public abstract class AbstractLoader
* @throws ParserConfigurationException if an error occurs
*/
protected AbstractLoader(Map<String, String> publicIdToResourceNameMap)
- throws SAXException, ParserConfigurationException {
+ throws SAXException, ParserConfigurationException {
this.publicIdToResourceNameMap =
Maps.newHashMap(publicIdToResourceNameMap);
final SAXParserFactory factory = SAXParserFactory.newInstance();
@@ -95,13 +95,13 @@ public abstract class AbstractLoader
* @throws SAXException in an error occurs
*/
public void parseInputSource(InputSource inputSource)
- throws IOException, SAXException {
+ throws IOException, SAXException {
parser.parse(inputSource);
}
@Override
public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException, IOException {
+ throws SAXException, IOException {
if (publicIdToResourceNameMap.keySet().contains(publicId)) {
final String dtdResourceName =
publicIdToResourceNameMap.get(publicId);
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java
index 959900490..fe0438415 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java
@@ -120,7 +120,7 @@ public class AutomaticBean
*/
@Override
public final void configure(Configuration config)
- throws CheckstyleException {
+ throws CheckstyleException {
configuration = config;
final String[] attributes = config.getAttributeNames();
@@ -191,7 +191,7 @@ public class AutomaticBean
*/
@Override
public final void contextualize(Context context)
- throws CheckstyleException {
+ throws CheckstyleException {
final Collection<String> attributes = context.getAttributeNames();
@@ -235,7 +235,7 @@ public class AutomaticBean
* @see Configuration#getChildren
*/
protected void setupChild(Configuration childConf)
- throws CheckstyleException {
+ throws CheckstyleException {
if (childConf != null) {
throw new CheckstyleException(childConf.getName() + " is not allowed as a child in "
+ getConfiguration().getName());
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java
index dd1f510bb..fa25cb6b9 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java
@@ -70,7 +70,7 @@ public class ClassResolver {
* @throws ClassNotFoundException if unable to resolve the class
*/
public Class<?> resolve(String name, String currentClass)
- throws ClassNotFoundException {
+ throws ClassNotFoundException {
// See if the class is full qualified
Class<?> clazz = resolveQualifiedName(name);
if (clazz != null) {
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java
index f9142628d..fe4308b86 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java
@@ -125,7 +125,7 @@ public class NewlineAtEndOfFileCheck
* provided reader
*/
private boolean endsWithNewline(RandomAccessFile randomAccessFile)
- throws IOException {
+ throws IOException {
final int len = lineSeparator.length();
if (randomAccessFile.length() < len) {
return false;
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java
index e82bf5b5b..7c11ba96b 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java
@@ -93,7 +93,7 @@ final class ImportControlLoader extends AbstractLoader {
final String localName,
final String qName,
final Attributes attributes)
- throws SAXException {
+ throws SAXException {
if ("import-control".equals(qName)) {
final String pkg = safeGet(attributes, PKG_ATTRIBUTE_NAME);
stack.push(new PkgControl(pkg));
@@ -196,7 +196,7 @@ final class ImportControlLoader extends AbstractLoader {
* @throws SAXException if the attribute does not exist.
*/
private static String safeGet(final Attributes attributes, final String name)
- throws SAXException {
+ throws SAXException {
final String returnValue = attributes.getValue(name);
if (returnValue == null) {
throw new SAXException("missing attribute " + name);
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java
index 3ebb574b1..82e3474a6 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java
@@ -71,7 +71,7 @@ public final class SuppressionsLoader
* @throws SAXException if an error occurs
*/
private SuppressionsLoader()
- throws ParserConfigurationException, SAXException {
+ throws ParserConfigurationException, SAXException {
super(createIdToResourceNameMap());
}
@@ -80,7 +80,7 @@ public final class SuppressionsLoader
String localName,
String qName,
Attributes attributes)
- throws SAXException {
+ throws SAXException {
if ("suppress".equals(qName)) {
//add SuppressElement filter to the filter chain
final String checks = attributes.getValue("checks");
@@ -121,7 +121,7 @@ public final class SuppressionsLoader
* @throws CheckstyleException if an error occurs.
*/
public static FilterSet loadSuppressions(String filename)
- throws CheckstyleException {
+ throws CheckstyleException {
// figure out if this is a File or a URL
final URI uri = CommonUtils.getUriByFilename(filename);
final InputSource source = new InputSource(uri.toString());
@@ -137,7 +137,7 @@ public final class SuppressionsLoader
*/
private static FilterSet loadSuppressions(
InputSource source, String sourceName)
- throws CheckstyleException {
+ throws CheckstyleException {
try {
final SuppressionsLoader suppressionsLoader =
new SuppressionsLoader();