Checkstyle fixes

This commit is contained in:
Andreas Dangel
2016-12-03 11:31:01 +01:00
parent 617c6c622c
commit d2bc0f3739
77 changed files with 232 additions and 147 deletions

View File

@ -566,7 +566,7 @@ public class PMDConfiguration extends AbstractConfiguration {
* @return The currently used analysis cache. Never null.
*/
public AnalysisCache getAnalysisCache() {
return analysisCache ;
return analysisCache;
}
/**

View File

@ -244,7 +244,7 @@ public class RuleSetFactory {
private RuleSet parseRuleSetNode(RuleSetReferenceId ruleSetReferenceId,
boolean withDeprecatedRuleReferences) throws RuleSetNotFoundException {
try (
final CheckedInputStream inputStream = new CheckedInputStream(
CheckedInputStream inputStream = new CheckedInputStream(
ruleSetReferenceId.getInputStream(this.classLoader), new Adler32());
) {
if (!ruleSetReferenceId.isExternal()) {

View File

@ -21,7 +21,6 @@ import net.sourceforge.pmd.PMDConfiguration;
import net.sourceforge.pmd.PMDException;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.RulePriority;
import net.sourceforge.pmd.RuleSet;
import net.sourceforge.pmd.RuleSetFactory;
import net.sourceforge.pmd.RuleSetNotFoundException;

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cache;
import java.io.File;
@ -109,4 +110,4 @@ public abstract class AbstractAnalysisCache implements AnalysisCache {
// Not interested in metrics
}
}
}

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cache;
import java.io.File;
@ -38,4 +39,4 @@ public interface AnalysisCache extends ReportListener {
* @param classLoader The class loader configured for this analysis.
*/
void checkValidity(RuleSets ruleSets, ClassLoader classLoader);
}
}

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cache;
import java.io.BufferedInputStream;
@ -36,7 +37,7 @@ public class AnalysisResult {
private static long computeFileChecksum(final File sourceFile) {
try (
final CheckedInputStream stream = new CheckedInputStream(
CheckedInputStream stream = new CheckedInputStream(
new BufferedInputStream(new FileInputStream(sourceFile)), new Adler32());
) {
// Just read it, the CheckedInputStream will update the checksum on it's own

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cache;
import java.io.BufferedInputStream;
@ -41,7 +42,7 @@ public class FileAnalysisCache extends AbstractAnalysisCache {
private void loadFromFile(final File cacheFile) {
if (cacheFile.exists()) {
try (
final DataInputStream inputStream = new DataInputStream(
DataInputStream inputStream = new DataInputStream(
new BufferedInputStream(new FileInputStream(cacheFile)));
) {
final String cacheVersion = inputStream.readUTF();
@ -74,7 +75,7 @@ public class FileAnalysisCache extends AbstractAnalysisCache {
@Override
public void persist() {
try (
final DataOutputStream outputStream = new DataOutputStream(
DataOutputStream outputStream = new DataOutputStream(
new BufferedOutputStream(new FileOutputStream(cacheFile)));
) {
outputStream.writeUTF(pmdVersion);

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cache;
import java.io.File;

View File

@ -59,7 +59,7 @@ public class MultiThreadProcessor extends AbstractPMDProcessor {
}
private void processReports(final List<Renderer> renderers, List<Future<Report>> tasks) throws Error {
private void processReports(final List<Renderer> renderers, List<Future<Report>> tasks) {
while (!tasks.isEmpty()) {
Future<Report> future = tasks.remove(0);

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd;
@ -59,8 +62,4 @@ public class FileSelectorTest {
boolean selected = fileSelector.accept(javaFile.getParentFile(), javaFile.getName());
assertEquals("Unwanted java file must not be selected!", false, selected);
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(FileSelectorTest.class);
}
}

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cache;
import static org.junit.Assert.assertFalse;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.jaxen;
@ -61,7 +64,7 @@ public class MatchesFunctionTest {
list.add(attrs);
list.add(exp);
Context c = new Context(null);
c.setNodeSet(new ArrayList());
c.setNodeSet(new ArrayList<>());
return function.call(c, list);
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.properties;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.renderers;
@ -24,8 +27,4 @@ public class EmacsRendererTest extends AbstractRendererTst {
public String getExpectedMultiple() {
return "n/a:1: blah" + PMD.EOL + "n/a:1: blah" + PMD.EOL;
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(EmacsRendererTest.class);
}
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.renderers;
@ -52,8 +55,4 @@ public class HTMLRendererTest extends AbstractRendererTst {
+ "<td>file</td>" + PMD.EOL + "<td>Error</td>" + PMD.EOL + "</tr>" + PMD.EOL + "</table></body></html>"
+ PMD.EOL;
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(HTMLRendererTest.class);
}
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.renderers;
@ -29,8 +32,4 @@ public class IDEAJRendererTest extends AbstractRendererTst {
return "blah" + PMD.EOL + " at Foo <init>(Foo.java:1)" + PMD.EOL + "blah" + PMD.EOL
+ " at Foo <init>(Foo.java:1)" + PMD.EOL;
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(IDEAJRendererTest.class);
}
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.renderers;
@ -30,8 +33,4 @@ public class TextRendererTest extends AbstractRendererTst {
public String getExpectedError(ProcessingError error) {
return "file\t-\tError" + PMD.EOL;
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(TextRendererTest.class);
}
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.renderers;

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.renderers;
@ -73,8 +76,4 @@ public class YAHTMLRendererTest extends AbstractRendererTst {
public String getExpectedError(ProcessingError error) {
return getExpected();
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(YAHTMLRendererTest.class);
}
}

View File

@ -1,3 +1,6 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
/**
* <copyright>
* Copyright 1997-2002 BBNT Solutions, LLC
@ -84,8 +87,4 @@ public class MetricTest {
Metric IUT = new Metric(testName, 0, 0.0, 0.0, 0.0, 0.0, stdev);
assertEquals(stdev, IUT.getStandardDeviation(), 0.05);
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(MetricTest.class);
}
}

Some files were not shown because too many files have changed in this diff Show More