Fix 2.2 eclipse-warnings

patch by Mick Semb Wever; reviewed by Benedict for CASSANDRA-15427
This commit is contained in:
Mick Semb Wever 2019-11-14 15:33:36 +01:00
parent 50b7094278
commit f05bf64fc1
No known key found for this signature in database
GPG Key ID: E91335D77E3E87CB
3 changed files with 3 additions and 6 deletions

View File

@ -844,6 +844,7 @@ public class CompactionManager implements CompactionManagerMBean
*
* @throws IOException
*/
@SuppressWarnings("resource")
private void doCleanupOne(final ColumnFamilyStore cfs, LifecycleTransaction txn, CleanupStrategy cleanupStrategy, Collection<Range<Token>> ranges, boolean hasIndexes) throws IOException
{
assert !cfs.isIndex();

View File

@ -215,6 +215,7 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
return maxSSTableSizeInMB * 1024L * 1024L;
}
@SuppressWarnings("resource")
public ScannerList getScanners(Collection<SSTableReader> sstables, Range<Token> range)
{
Set<SSTableReader>[] sstablesPerLevel = manifest.getSStablesPerLevelSnapshot();

View File

@ -312,8 +312,7 @@ public class SSTableExport
excludeSet = new HashSet<>(Arrays.asList(excludes));
SSTableIdentityIterator row;
ISSTableScanner scanner = reader.getScanner();
try
try (ISSTableScanner scanner = reader.getScanner())
{
outs.println("[");
@ -340,10 +339,6 @@ public class SSTableExport
outs.println("\n]");
outs.flush();
}
finally
{
scanner.close();
}
}
/**