Fixing broken windows...... http://www.artima.com/intv/fixitP.html
This commit is contained in:
parent
7e34b7d408
commit
0ac2db237e
|
|
@ -78,17 +78,18 @@ public abstract class AbstractFileSetCheck
|
|||
*/
|
||||
protected final File[] filter(File[] aFiles)
|
||||
{
|
||||
if (mFileExtensions == null || mFileExtensions.length == 0) {
|
||||
if ((mFileExtensions == null) || (mFileExtensions.length == 0)) {
|
||||
return aFiles;
|
||||
}
|
||||
ArrayList files = new ArrayList(aFiles.length);
|
||||
|
||||
final ArrayList files = new ArrayList(aFiles.length);
|
||||
for (int i = 0; i < aFiles.length; i++) {
|
||||
File file = aFiles[i];
|
||||
final String fileName = file.getName();
|
||||
final File f = aFiles[i];
|
||||
final String fileName = f.getName();
|
||||
for (int j = 0; j < mFileExtensions.length; j++) {
|
||||
String fileExtension = mFileExtensions[j];
|
||||
final String fileExtension = mFileExtensions[j];
|
||||
if (fileName.endsWith(fileExtension)) {
|
||||
files.add(file);
|
||||
files.add(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -107,9 +108,10 @@ public abstract class AbstractFileSetCheck
|
|||
mFileExtensions = null;
|
||||
return;
|
||||
}
|
||||
|
||||
mFileExtensions = new String[aExtensions.length];
|
||||
for (int i = 0; i < aExtensions.length; i++) {
|
||||
String extension = aExtensions[i];
|
||||
final String extension = aExtensions[i];
|
||||
if (extension.startsWith(".")) {
|
||||
mFileExtensions[i] = extension;
|
||||
}
|
||||
|
|
@ -149,10 +151,12 @@ public abstract class AbstractFileSetCheck
|
|||
protected final void log(int aLineNo, int aColNo,
|
||||
String aKey, Object[] aArgs)
|
||||
{
|
||||
getMessageCollector().add(new LocalizedMessage(
|
||||
aLineNo, aColNo, getMessageBundle(),
|
||||
aKey, aArgs, getSeverityLevel()));
|
||||
getMessageCollector().add(
|
||||
new LocalizedMessage(aLineNo,
|
||||
aColNo,
|
||||
getMessageBundle(),
|
||||
aKey,
|
||||
aArgs,
|
||||
getSeverityLevel()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ package com.puppycrawl.tools.checkstyle.api;
|
|||
*
|
||||
* @author lkuehne
|
||||
*/
|
||||
public abstract class AbstractViolationReporter extends AutomaticBean
|
||||
public abstract class AbstractViolationReporter
|
||||
extends AutomaticBean
|
||||
{
|
||||
/** resuable constant for message formating */
|
||||
private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
|
||||
|
|
@ -205,7 +206,9 @@ public abstract class AbstractViolationReporter extends AutomaticBean
|
|||
*
|
||||
* @see java.text.MessageFormat
|
||||
*/
|
||||
protected abstract void log(int aLine, int aCol,
|
||||
String aKey, Object[] aArgs);
|
||||
protected abstract void log(int aLine,
|
||||
int aCol,
|
||||
String aKey,
|
||||
Object[] aArgs);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue