aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2016-07-12 14:27:15 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2016-07-12 14:27:19 +0200
commit6bffda848ed609d1761de69db7f7360c02172719 (patch)
tree2ea1c766a92951a9068ed50813bde3ccbb0ab7d4 /sonar-scanner-engine
parent7bea09f6eb442441908de2df48b0ed7dd75e001f (diff)
downloadsonarqube-6bffda848ed609d1761de69db7f7360c02172719.tar.gz
sonarqube-6bffda848ed609d1761de69db7f7360c02172719.zip
Improve quality
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java7
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java7
2 files changed, 2 insertions, 12 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java
index 07b03c18257..285a25d6848 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java
@@ -114,12 +114,7 @@ public class CpdExecutor {
List<CloneGroup> duplications;
Future<List<CloneGroup>> futureResult = null;
try {
- futureResult = executorService.submit(new Callable<List<CloneGroup>>() {
- @Override
- public List<CloneGroup> call() throws Exception {
- return SuffixTreeCloneDetectionAlgorithm.detect(index, fileBlocks);
- }
- });
+ futureResult = executorService.submit(() -> SuffixTreeCloneDetectionAlgorithm.detect(index, fileBlocks));
duplications = futureResult.get(TIMEOUT, TimeUnit.SECONDS);
} catch (TimeoutException e) {
LOG.warn("Timeout during detection of duplications for " + inputFile.absolutePath());
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java
index c2d14632cfa..1640ce17ff0 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java
@@ -53,11 +53,6 @@ public class WorkDirectoryCleaner {
}
private DirectoryStream<Path> list() throws IOException {
- return Files.newDirectoryStream(workDir, new DirectoryStream.Filter<Path>() {
- @Override
- public boolean accept(Path entry) throws IOException {
- return !DirectoryLock.LOCK_FILE_NAME.equals(entry.getFileName().toString());
- }
- });
+ return Files.newDirectoryStream(workDir, entry -> !DirectoryLock.LOCK_FILE_NAME.equals(entry.getFileName().toString()));
}
}