Skip to content

Commit c4b1b1e

Browse files
author
Vladimir Kotal
committed
treat compilation warnings as errors
fixes #2246
1 parent aa04e27 commit c4b1b1e

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/RuntimeEnvironment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ public List<Project> getProjectList() {
472472
*
473473
* @return a Map with all of the projects
474474
*/
475+
@SuppressWarnings("unchecked")
475476
public Map<String,Project> getProjects() {
476477
return (Map<String,Project>)getConfigurationValue("projects");
477478
}
@@ -516,6 +517,7 @@ public boolean hasGroups() {
516517
*
517518
* @return a set containing all of the groups (may be null)
518519
*/
520+
@SuppressWarnings("unchecked")
519521
public Set<Group> getGroups() {
520522
return (Set<Group>)getConfigurationValue("groups");
521523
}
@@ -723,6 +725,7 @@ public void setQuickContextScan(boolean quickContextScan) {
723725
setConfigurationValue("quickContextScan", quickContextScan);
724726
}
725727

728+
@SuppressWarnings("unchecked")
726729
public List<RepositoryInfo> getRepositories() {
727730
return (List<RepositoryInfo>)getConfigurationValue("repositories");
728731
}
@@ -790,6 +793,7 @@ public void setDefaultProjects(Set<Project> defaultProjects) {
790793
*
791794
* @return the default projects (may be null if not specified)
792795
*/
796+
@SuppressWarnings("unchecked")
793797
public Set<Project> getDefaultProjects() {
794798
Set<Project> projects = (Set<Project>)getConfigurationValue("defaultProjects");
795799
if (projects == null) {
@@ -1161,6 +1165,7 @@ public void setCTagsExtraOptionsFile(String filename) {
11611165
setConfigurationValue("CTagsExtraOptionsFile", filename);
11621166
}
11631167

1168+
@SuppressWarnings("unchecked")
11641169
public Set<String> getAllowedSymlinks() {
11651170
return (Set<String>)getConfigurationValue("allowedSymlinks");
11661171
}

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public static void main(String argv[]) {
318318
// Get history first.
319319
getInstance().prepareIndexer(env, searchRepositories, addProjects,
320320
defaultProjects,
321-
listFiles, createDict, subFiles, new ArrayList(repositories),
321+
listFiles, createDict, subFiles, new ArrayList<>(repositories),
322322
zapCache, listRepos);
323323
if (listRepos || !zapCache.isEmpty()) {
324324
return;

opengrok-indexer/src/main/java/org/opengrok/indexer/util/ClassUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public static void remarkTransientFields(Class targetClass) {
7777
}
7878
}
7979

80+
@SuppressWarnings("unchecked")
8081
private static Object stringToObject(String fieldName, Class c, String value) throws IOException {
8182
Object v;
8283
String paramClass = c.getName();

opengrok-web/src/main/java/org/opengrok/web/api/v1/suggester/query/SuggesterQueryParser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ protected Query newFuzzyQuery(final Term term, final float minimumSimilarity, fi
230230
replaceIdentifier(term.field(), term.text() + "~" + ((int) minimumSimilarity));
231231
}
232232

233+
@SuppressWarnings("deprecation")
233234
int numEdits = FuzzyQuery.floatToEdits(minimumSimilarity,
234235
newTerm.text().codePointCount(0, newTerm.text().length()));
235236

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
198198
<source>${compileSource}</source>
199199
<target>${compileTarget}</target>
200200
<encoding>${project.build.sourceEncoding}</encoding>
201+
<compilerArgs>
202+
<arg>-Xlint:all</arg>
203+
<arg>-Werror</arg>
204+
</compilerArgs>
201205
</configuration>
202206
<version>3.6.1</version>
203207
</plugin>

0 commit comments

Comments
 (0)