Skip to content

Commit 0e4c555

Browse files
ahornaceVladimir Kotal
authored andcommitted
Add check for trailing spaces
1 parent 917059f commit 0e4c555

File tree

155 files changed

+587
-597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+587
-597
lines changed

dev/checkstyle/style.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
<module name="FileLength"/>
1414
<module name="FileTabCharacter"/>
1515

16+
<module name="RegexpSingleline">
17+
<property name="format" value="\s+$"/>
18+
<property name="minimum" value="0"/>
19+
<property name="maximum" value="0"/>
20+
<property name="message" value="Line has trailing spaces."/>
21+
</module>
22+
1623
<module name="LineLength">
1724
<property name="max" value="150"/>
1825
</module>

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuru.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public class AnalyzerGuru {
216216
* List of all registered {@code FileAnalyzerFactory} instances.
217217
*/
218218
private static final List<AnalyzerFactory> factories = new ArrayList<>();
219-
219+
220220
/**
221221
* Names of all analysis packages.
222222
*/
@@ -768,35 +768,35 @@ public static AnalyzerFactory findByFileTypeName(String fileTypeName) {
768768
* @throws InvocationTargetException if the underlying constructor throws an exception
769769
*/
770770
public static AnalyzerFactory findFactory(String factoryClassName)
771-
throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException,
771+
throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException,
772772
InvocationTargetException {
773773
Class<?> fcn;
774774
try {
775775
fcn = Class.forName(factoryClassName);
776-
776+
777777
} catch (ClassNotFoundException e) {
778778
fcn = getFactoryClass(factoryClassName);
779-
779+
780780
if (fcn == null) {
781781
throw new ClassNotFoundException("Unable to locate class " + factoryClassName);
782782
}
783783
}
784-
784+
785785
return findFactory(fcn);
786786
}
787787

788788
/**
789789
* Get Analyzer factory class using class simple name.
790-
*
790+
*
791791
* @param simpleName which may be either the factory class
792792
* simple name (eg. CAnalyzerFactory), the analyzer name
793793
* (eg. CAnalyzer), or the language name (eg. C)
794-
*
794+
*
795795
* @return the analyzer factory class, or null when not found.
796796
*/
797797
public static Class<?> getFactoryClass(String simpleName) {
798798
Class<?> factoryClass = null;
799-
799+
800800
// Build analysis package name list first time only
801801
if (analysisPkgNames.isEmpty()) {
802802
Package[] p = Package.getPackages();
@@ -807,17 +807,17 @@ public static Class<?> getFactoryClass(String simpleName) {
807807
}
808808
}
809809
}
810-
810+
811811
// This allows user to enter the language or analyzer name
812812
// (eg. C or CAnalyzer vs. CAnalyzerFactory)
813813
// Note that this assumes a regular naming scheme of
814-
// all language parsers:
814+
// all language parsers:
815815
// <language>Analyzer, <language>AnalyzerFactory
816-
816+
817817
if (!simpleName.contains("Analyzer")) {
818818
simpleName += "Analyzer";
819819
}
820-
820+
821821
if (!simpleName.contains("Factory")) {
822822
simpleName += "Factory";
823823
}
@@ -831,10 +831,10 @@ public static Class<?> getFactoryClass(String simpleName) {
831831
// Ignore
832832
}
833833
}
834-
834+
835835
return factoryClass;
836836
}
837-
837+
838838
/**
839839
* Find a {@code FileAnalyzerFactory} which is an instance of the specified
840840
* class. If one doesn't exist, create one and register it.

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/FileAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected TokenStreamComponents createComponents(String fieldName) {
185185
try (HistoryAnalyzer historyAnalyzer = new HistoryAnalyzer()) {
186186
return historyAnalyzer.createComponents(fieldName);
187187
}
188-
//below is set by PlainAnalyzer to workaround #1376 symbols search works like full text search
188+
//below is set by PlainAnalyzer to workaround #1376 symbols search works like full text search
189189
case QueryBuilder.REFS: {
190190
return new TokenStreamComponents(symbolTokenizerFactory.get());
191191
}

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/HistoryAnalyzer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,26 @@ public HistoryAnalyzer() {
5353
super(Analyzer.PER_FIELD_REUSE_STRATEGY);
5454
stopWords = StopFilter.makeStopSet(ENGLISH_STOP_WORDS);
5555
}
56-
56+
5757
/**
5858
* Creates components using a new {@link PlainFullTokenizer}, filtered using
5959
* a default set of English stop-words.
60-
* @param fieldName name of field for which to create components
60+
* @param fieldName name of field for which to create components
6161
* @return components for this analyzer (NB safe to use even if this
6262
* analyzer were to be garbage-collected)
6363
*/
6464
@Override
65-
protected TokenStreamComponents createComponents(String fieldName) {
65+
protected TokenStreamComponents createComponents(String fieldName) {
6666
JFlexTokenizer plainfull = new JFlexTokenizer(new PlainFullTokenizer(
6767
AbstractAnalyzer.DUMMY_READER));
6868
//we are counting position increments, this might affect the queries
6969
//later and need to be in sync, especially for highlighting of results
7070
return new TokenStreamComponents(plainfull, new StopFilter(plainfull,
7171
stopWords));
7272
}
73-
73+
7474
@Override
75-
protected TokenStream normalize(String fieldName, TokenStream in) {
75+
protected TokenStream normalize(String fieldName, TokenStream in) {
7676
return new LowerCaseFilter(in);
77-
}
77+
}
7878
}

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/JFlexNonXref.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ protected boolean writeSymbol(String symbol, Set<String> keywords, int line,
465465
boolean caseSensitive) throws IOException {
466466
return writeSymbol(symbol, keywords, line, caseSensitive, false);
467467
}
468-
468+
469469
/**
470470
* Write a symbol and generate links as appropriate.
471471
*

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/PathTokenizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*/
5050
public class PathTokenizer extends Tokenizer {
5151

52-
// below should be '/' since we try to convert even windows file separators
52+
// below should be '/' since we try to convert even windows file separators
5353
// to unix ones
5454
public static final char DEFAULT_DELIMITER = '/';
5555
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ada/AdaAnalyzerFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
*/
3333
public class AdaAnalyzerFactory extends FileAnalyzerFactory {
3434

35-
private static final String name = "Ada";
36-
35+
private static final String NAME = "Ada";
36+
3737
private static final String[] SUFFIXES = {
3838
"ADA",
3939
"ADB",
4040
"ADS"
4141
};
4242

4343
public AdaAnalyzerFactory() {
44-
super(null, null, SUFFIXES, null, null, "text/plain", AbstractAnalyzer.Genre.PLAIN, name);
44+
super(null, null, SUFFIXES, null, null, "text/plain", AbstractAnalyzer.Genre.PLAIN, NAME);
4545
}
4646

4747
@Override

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/ada/Consts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class Consts {
104104
kwd.add("while");
105105
kwd.add("with");
106106
kwd.add("xor");
107-
107+
108108
kwd.add("ascii"); // A.1 The Package Standard
109109
kwd.add("base"); // A.1 The Package Standard
110110
kwd.add("boolean"); // A.1 The Package Standard

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/BZip2Analyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ public InputStream getStream() throws IOException {
127127
}
128128
}
129129
};
130-
}
130+
}
131131
}

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/archive/BZip2AnalyzerFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import org.opengrok.indexer.analysis.FileAnalyzerFactory;
2727

2828
public class BZip2AnalyzerFactory extends FileAnalyzerFactory {
29-
30-
private static final String name = "Bzip(2)";
31-
29+
30+
private static final String NAME = "Bzip(2)";
31+
3232
private static final String[] SUFFIXES = {
3333
"BZ", "BZ2"
3434
};
@@ -38,7 +38,7 @@ public class BZip2AnalyzerFactory extends FileAnalyzerFactory {
3838
};
3939

4040
public BZip2AnalyzerFactory() {
41-
super(null, null, SUFFIXES, MAGICS, null, null, null, name);
41+
super(null, null, SUFFIXES, MAGICS, null, null, null, NAME);
4242
}
4343

4444
@Override

0 commit comments

Comments
 (0)