Skip to content

Commit 523d6b7

Browse files
vladakahornace
authored andcommitted
suppress 'Use try-with-resources or close' Sonar warning
1 parent 8628dce commit 523d6b7

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,7 @@ public void maybeRefreshIndexSearchers() {
17821782
* @return SearcherManager for given project
17831783
* @throws IOException I/O exception
17841784
*/
1785+
@SuppressWarnings("java:S2095")
17851786
public SuperIndexSearcher getIndexSearcher(String projectName) throws IOException {
17861787
SearcherManager mgr = searcherManagerMap.get(projectName);
17871788
SuperIndexSearcher searcher;

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

+1
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,7 @@ public void listTokens(int freq) throws IOException {
16031603
* @return The index database where the file should be located or null if it
16041604
* cannot be located.
16051605
*/
1606+
@SuppressWarnings("java:S2095")
16061607
public static IndexReader getIndexReader(String path) {
16071608
IndexReader ret = null;
16081609

suggester/src/main/java/org/opengrok/suggest/SuggesterProjectData.java

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ private void createSuggesterDir() throws IOException {
288288
}
289289
}
290290

291+
@SuppressWarnings("java:S2095")
291292
private void initSearchCountMap() throws IOException {
292293
searchCountMaps.values().forEach(PopularityMap::close);
293294
searchCountMaps.clear();

suggester/src/main/java/org/opengrok/suggest/popular/impl/chronicle/ChronicleMapAdapter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package org.opengrok.suggest.popular.impl.chronicle;
2424

@@ -110,6 +110,7 @@ public void removeIf(final Predicate<BytesRef> predicate) {
110110
* @param newMapAvgKey new average key size
111111
* @throws IOException if some error occurred
112112
*/
113+
@SuppressWarnings("java:S2095")
113114
public void resize(final int newMapSize, final double newMapAvgKey) throws IOException {
114115
if (newMapSize < 0) {
115116
throw new IllegalArgumentException("Cannot resize chronicle map to negative size");

0 commit comments

Comments
 (0)