]> source.dussan.org Git - sonarqube.git/commitdiff
Useless code
authorDavid Gageot <david@gageot.net>
Tue, 12 May 2015 08:42:31 +0000 (10:42 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 12 May 2015 12:33:41 +0000 (14:33 +0200)
203 files changed:
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java
server/sonar-process-monitor/src/main/java/org/sonar/process/monitor/JavaCommand.java
server/sonar-process-monitor/src/main/java/org/sonar/process/monitor/JavaProcessLauncher.java
server/sonar-process-monitor/src/main/java/org/sonar/process/monitor/Monitor.java
server/sonar-process/src/main/java/org/sonar/process/Encryption.java
server/sonar-process/src/main/java/org/sonar/process/MinimumViableSystem.java
server/sonar-search/src/main/java/org/sonar/search/script/ListUpdate.java
server/sonar-search/src/test/java/org/sonar/search/script/UpdateListScriptTest.java
server/sonar-server/src/main/java/org/sonar/server/db/BaseDao.java
server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java
server/sonar-server/src/main/java/org/sonar/server/db/migrations/v36/Referentials.java
server/sonar-server/src/main/java/org/sonar/server/db/migrations/v50/FileSourceDto.java
server/sonar-server/src/main/java/org/sonar/server/es/NewIndex.java
server/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeQuery.java
server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
server/sonar-server/src/main/java/org/sonar/server/issue/Result.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileExporters.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLoader.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileService.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndex.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleNormalizer.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileChangelogAction.java
server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java
server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java
server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java
server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java
server/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java
server/sonar-server/src/main/java/org/sonar/server/search/BaseNormalizer.java
server/sonar-server/src/main/java/org/sonar/server/search/Facets.java
server/sonar-server/src/main/java/org/sonar/server/search/IndexClient.java
server/sonar-server/src/main/java/org/sonar/server/search/IndexQueue.java
server/sonar-server/src/main/java/org/sonar/server/search/Result.java
server/sonar-server/src/main/java/org/sonar/server/search/action/DeleteKey.java
server/sonar-server/src/main/java/org/sonar/server/search/action/DeleteNestedItem.java
server/sonar-server/src/main/java/org/sonar/server/search/action/InsertDto.java
server/sonar-server/src/main/java/org/sonar/server/search/action/UpsertNestedItem.java
server/sonar-server/src/main/java/org/sonar/server/source/CharactersReader.java
server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/BarChartTest.java
server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/CustomBarChartTest.java
server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/PieChartTest.java
server/sonar-server/src/test/java/org/sonar/server/charts/deprecated/SparkLinesChartTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/BaseDataChangeTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyPutMappingRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/search/action/DeleteKeyTest.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/SonarClient.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/internal/EncodingUtils.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/ActionPlanQuery.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/BulkChangeQuery.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewActionPlan.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/NewIssue.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/UpdateActionPlan.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClient.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultBulkChange.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChange.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssues.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/IssueJsonParser.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/permissions/PermissionParameters.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/project/NewProject.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileResult.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/NewCondition.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/UpdateCondition.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClient.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGates.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Measure.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Source.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshaller.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshaller.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/UserParameters.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/UserQuery.java
server/sonar-ws-client/src/main/java/org/sonar/wsclient/user/internal/DefaultUserClient.java
sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java
sonar-batch-protocol/src/main/gen-java/org/sonar/server/source/db/FileSourceDb.java
sonar-batch-protocol/src/main/gen-java/org/sonar/server/source/db/FileSourceTestDb.java
sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ActiveRule.java
sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/GlobalRepositories.java
sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java
sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchExtensionDictionnary.java
sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcLeakPrevention.java
sonar-batch/src/main/java/org/sonar/batch/debt/DebtDecorator.java
sonar-batch/src/main/java/org/sonar/batch/deprecated/decorator/DecoratorsSelector.java
sonar-batch/src/main/java/org/sonar/batch/design/DirectoryDsmDecorator.java
sonar-batch/src/main/java/org/sonar/batch/design/DsmDecorator.java
sonar-batch/src/main/java/org/sonar/batch/design/MavenDependenciesSensor.java
sonar-batch/src/main/java/org/sonar/batch/design/ProjectDsmDecorator.java
sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java
sonar-batch/src/main/java/org/sonar/batch/index/BatchResource.java
sonar-batch/src/main/java/org/sonar/batch/index/Cache.java
sonar-batch/src/main/java/org/sonar/batch/index/Caches.java
sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
sonar-batch/src/main/java/org/sonar/batch/index/ResourceKeyMigration.java
sonar-batch/src/main/java/org/sonar/batch/mediumtest/BatchMediumTester.java
sonar-batch/src/main/java/org/sonar/batch/mediumtest/TaskResult.java
sonar-batch/src/main/java/org/sonar/batch/phases/PhasesTimeProfiler.java
sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java
sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
sonar-batch/src/main/java/org/sonar/batch/profiling/PhaseProfiling.java
sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
sonar-batch/src/main/java/org/sonar/batch/repository/language/DefaultLanguagesRepository.java
sonar-batch/src/main/java/org/sonar/batch/rule/RulesProfileWrapper.java
sonar-batch/src/main/java/org/sonar/batch/rule/UsedQProfiles.java
sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorValidator.java
sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultModuleFileSystem.java
sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java
sonar-batch/src/main/java/org/sonar/batch/scan/report/IssuesReport.java
sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java
sonar-batch/src/main/java/org/sonar/batch/scan/report/ReportSummary.java
sonar-batch/src/main/java/org/sonar/batch/scan/report/ResourceReport.java
sonar-batch/src/main/java/org/sonar/batch/scan/report/SourceProvider.java
sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java
sonar-batch/src/main/java/org/sonar/batch/scm/ScmConfiguration.java
sonar-batch/src/main/java/org/sonar/batch/scm/ScmSensor.java
sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java
sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java
sonar-batch/src/main/java/org/sonar/batch/source/HighlightingRenderer.java
sonar-batch/src/test/java/org/sonar/batch/design/DirectoryDsmDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/design/DsmSerializerTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
sonar-colorizer/src/main/java/org/sonar/colorizer/HtmlRenderer.java
sonar-colorizer/src/main/java/org/sonar/colorizer/KeywordsTokenizer.java
sonar-colorizer/src/test/java/org/sonar/colorizer/CodeColorizerTest.java
sonar-core/src/main/java/org/sonar/core/component/ScanGraph.java
sonar-core/src/main/java/org/sonar/core/graph/BeanVertex.java
sonar-core/src/main/java/org/sonar/core/graph/graphson/GraphsonUtil.java
sonar-core/src/main/java/org/sonar/core/permission/PermissionFacade.java
sonar-core/src/main/java/org/sonar/core/persistence/DbSession.java
sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java
sonar-core/src/main/java/org/sonar/core/purge/PurgeProfiler.java
sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java
sonar-core/src/main/java/org/sonar/core/rule/CacheRuleFinder.java
sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java
sonar-core/src/main/java/org/sonar/jpa/dao/MeasuresDao.java
sonar-core/src/main/java/org/sonar/jpa/session/JpaDatabaseSession.java
sonar-core/src/main/java/org/sonar/jpa/session/ThreadLocalDatabaseSessionFactory.java
sonar-core/src/test/java/org/sonar/core/graph/graphson/GraphsonReaderTest.java
sonar-core/src/test/java/org/sonar/core/graph/graphson/GraphsonUtilTest.java
sonar-deprecated/src/main/java/org/sonar/api/charts/ChartParameters.java
sonar-deprecated/src/main/java/org/sonar/api/rules/XMLRuleParser.java
sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java
sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java
sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/AbstractText.java
sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Node.java
sonar-duplications/src/main/java/org/sonar/duplications/index/CloneGroup.java
sonar-duplications/src/main/java/org/sonar/duplications/statement/StatementChannel.java
sonar-duplications/src/main/java/org/sonar/duplications/statement/StatementChunker.java
sonar-duplications/src/main/java/org/sonar/duplications/statement/matcher/UptoTokenMatcher.java
sonar-duplications/src/main/java/org/sonar/duplications/token/TokenQueue.java
sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/StringSuffixTree.java
sonar-duplications/src/test/java/org/sonar/duplications/token/TokenQueueTest.java
sonar-graph/src/main/java/org/sonar/graph/CycleDetector.java
sonar-graph/src/main/java/org/sonar/graph/DirectedGraph.java
sonar-graph/src/main/java/org/sonar/graph/DsmManualSorter.java
sonar-graph/src/main/java/org/sonar/graph/DsmScanner.java
sonar-graph/src/main/java/org/sonar/graph/DsmTopologicalSorter.java
sonar-graph/src/main/java/org/sonar/graph/FeedbackCycle.java
sonar-graph/src/main/java/org/sonar/graph/IncrementalCyclesAndFESSolver.java
sonar-graph/src/main/java/org/sonar/graph/MinimumFeedbackEdgeSetSolver.java
sonar-graph/src/test/java/org/sonar/graph/CycleDetectorTest.java
sonar-graph/src/test/java/org/sonar/graph/DsmManualSorterTest.java
sonar-graph/src/test/java/org/sonar/graph/DsmPrinterTest.java
sonar-graph/src/test/java/org/sonar/graph/DsmTopologicalSorterTest.java
sonar-graph/src/test/java/org/sonar/graph/FeedbackCycleTest.java
sonar-graph/src/test/java/org/sonar/graph/IncrementalCyclesAndFESSolverTest.java
sonar-graph/src/test/java/org/sonar/graph/MinimumFeedbackEdgeSetSolverTest.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultFilePredicates.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultFileSystem.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/FileMetadata.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/CheckFactory.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultActiveRules.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewActiveRule.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/RulesBuilder.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/duplication/internal/DefaultDuplication.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java
sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
sonar-plugin-api/src/main/java/org/sonar/api/measures/PropertiesBuilder.java
sonar-plugin-api/src/main/java/org/sonar/api/measures/RangeDistributionBuilder.java
sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileParser.java
sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java
sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/LocalizedMessages.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/ManifestUtils.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/ValidationMessages.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/WildcardPattern.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/XpathParser.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/dag/DirectAcyclicGraph.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/dag/Node.java
sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/user/UserQueryTest.java

index b78deb2812cd17c584de9133723bb10190b7bf6f..0d1c978e0de86bab3aa284171db6abfea235b8bb 100644 (file)
@@ -54,7 +54,7 @@ public class XooBlameCommand extends BlameCommand {
 
     try {
       List<String> lines = FileUtils.readLines(scmDataFile, Charsets.UTF_8.name());
-      List<BlameLine> blame = new ArrayList<BlameLine>(lines.size());
+      List<BlameLine> blame = new ArrayList<>(lines.size());
       int lineNumber = 0;
       for (String line : lines) {
         lineNumber++;
index d4b774cb851cd11c3980306b9ed7b09253d408c2..baeb769d33713c047f76e6702cc4ad4c5255bb77 100644 (file)
@@ -39,18 +39,18 @@ public class JavaCommand {
   private File workDir;
 
   // for example -Xmx1G
-  private final List<String> javaOptions = new ArrayList<String>();
+  private final List<String> javaOptions = new ArrayList<>();
 
   // entry point
   private String className;
 
   // relative path to JAR files
-  private final List<String> classpath = new ArrayList<String>();
+  private final List<String> classpath = new ArrayList<>();
 
   // program arguments (parameters of main(String[])
-  private final Map<String, String> arguments = new LinkedHashMap<String, String>();
+  private final Map<String, String> arguments = new LinkedHashMap<>();
 
-  private final Map<String, String> envVariables = new HashMap<String, String>(System.getenv());
+  private final Map<String, String> envVariables = new HashMap<>(System.getenv());
 
   private File tempDir = null;
 
index dd67a10489dead04652de6f01b95b39198ecd0e7..1e3ee06648e677d976b2c87ea908f7042509c23e 100644 (file)
@@ -64,7 +64,7 @@ public class JavaProcessLauncher {
   }
 
   private ProcessBuilder create(JavaCommand javaCommand) {
-    List<String> commands = new ArrayList<String>();
+    List<String> commands = new ArrayList<>();
     commands.add(buildJavaPath());
     commands.addAll(javaCommand.getJavaOptions());
     // TODO warning - does it work if temp dir contains a whitespace ?
index fd546b9df5dcf4bf5d774b33d7dfef84c66797fd..df3d53518ee9d585929539cdc3840416825d568d 100644 (file)
@@ -30,7 +30,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 
 public class Monitor {
 
-  private final List<ProcessRef> processes = new CopyOnWriteArrayList<ProcessRef>();
+  private final List<ProcessRef> processes = new CopyOnWriteArrayList<>();
   private final TerminatorThread terminator;
   private final JavaProcessLauncher launcher;
   private final Lifecycle lifecycle = new Lifecycle();
@@ -39,7 +39,7 @@ public class Monitor {
   private Thread shutdownHook = new Thread(new MonitorShutdownHook(), "Monitor Shutdown Hook");
 
   // used by awaitStop() to block until all processes are shutdown
-  private final List<WatcherThread> watcherThreads = new CopyOnWriteArrayList<WatcherThread>();
+  private final List<WatcherThread> watcherThreads = new CopyOnWriteArrayList<>();
   static int nextProcessId = 0;
 
   Monitor(JavaProcessLauncher launcher, SystemExit exit, TerminatorThread terminator) {
index cca05e6c780454bfdc6e34af9de0bbfd1f169886..fe9d66ec08f1501c9d67884afa6c311b75e61cb7 100644 (file)
@@ -37,7 +37,7 @@ public final class Encryption {
   private static final String AES_ALGORITHM = "aes";
   private final AesCipher aesCipher;
 
-  private final Map<String, Cipher> ciphers = new HashMap<String, Cipher>();
+  private final Map<String, Cipher> ciphers = new HashMap<>();
   private static final Pattern ENCRYPTED_PATTERN = Pattern.compile("\\{(.*?)\\}(.*)");
 
   public Encryption(@Nullable String pathToSecretKey) {
index 2389fa5aa189cdfa85872c13a0bc61b32c442ade..fdbc721761164a8ed5b2679e26b7d10518466db6 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Map;
 
 public class MinimumViableSystem {
 
-  private final Map<String, String> requiredJavaOptions = new HashMap<String, String>();
+  private final Map<String, String> requiredJavaOptions = new HashMap<>();
 
   public MinimumViableSystem setRequiredJavaOption(String propertyKey, String expectedValue) {
     requiredJavaOptions.put(propertyKey, expectedValue);
index 587825f60f59cc14578fca371910ffff08207f20..d93ae29b515aaf293a30bd45154b02e6d2a4fd76 100644 (file)
@@ -99,7 +99,7 @@ public class ListUpdate extends AbstractExecutableScript {
 
       if (fieldValue == null && value != null) {
         // 0. The field does not exist (this is a upsert then)
-        List values = new ArrayList<Object>(1);
+        List values = new ArrayList<>(1);
         values.add(value);
         source.put(field, values);
       } else if (!XContentMapValues.isArray(fieldValue) && value != null) {
@@ -108,7 +108,7 @@ public class ListUpdate extends AbstractExecutableScript {
         if (XContentMapValues.nodeStringValue(currentFieldValue.get(idField), null).equals(idValue)) {
           source.put(field, value);
         } else {
-          List values = new ArrayList<Object>(2);
+          List values = new ArrayList<>(2);
           values.add(fieldValue);
           values.add(value);
           source.put(field, values);
index 06c2c355c7352759d9270aae43ed6d1fcb9e0822..360f8a4d021039d080386b02d37a49e939e6ff94 100644 (file)
@@ -43,7 +43,7 @@ public class UpdateListScriptTest {
 
   @Test
   public void fail_missing_attributes_field() {
-    Map<String, Object> params = new HashMap<String, Object>();
+    Map<String, Object> params = new HashMap<>();
 
     // Missing everything
     try {
@@ -105,11 +105,11 @@ public class UpdateListScriptTest {
 
     String listField = "listField";
     Collection<Map<String, Object>> mapFields;
-    Map source = new HashMap<String, Object>();
+    Map source = new HashMap<>();
     source.put("field1", "value1");
 
     // 0 Create list when field does not exists
-    Map<String, Object> params = new HashMap<String, Object>();
+    Map<String, Object> params = new HashMap<>();
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_FIELD, listField);
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_FIELD, "key");
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_VALUE, "1");
@@ -124,7 +124,7 @@ public class UpdateListScriptTest {
     assertThat(mapFields).hasSize(1);
 
     // Add item to existing list
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_FIELD, listField);
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_FIELD, "key");
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_VALUE, "2");
@@ -136,7 +136,7 @@ public class UpdateListScriptTest {
     assertThat(mapFields).hasSize(2);
 
     // updated first item in list
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_FIELD, listField);
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_FIELD, "key");
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_VALUE, "1");
@@ -148,7 +148,7 @@ public class UpdateListScriptTest {
     assertThat(mapFields).hasSize(2);
 
     // updated second item in list
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_FIELD, listField);
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_FIELD, "key");
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_VALUE, "2");
@@ -160,7 +160,7 @@ public class UpdateListScriptTest {
     assertThat(mapFields).hasSize(2);
 
     // delete first item
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_FIELD, listField);
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_FIELD, "key");
     params.put(ProcessProperties.ES_PLUGIN_LISTUPDATE_ID_VALUE, "1");
@@ -173,7 +173,7 @@ public class UpdateListScriptTest {
   }
 
   private Map<String, Object> mapOf(String k, String v, String k1, String v1) {
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
     map.put(k, v);
     map.put(k1, v1);
     return map;
index 1fe29ad23c4718f808c4f4db0f070db1cbe23d16..e08752018568e268648430e10e563a984ea42273 100644 (file)
@@ -251,7 +251,7 @@ public abstract class BaseDao<MAPPER, DTO extends Dto<KEY>, KEY extends Serializ
     try {
       doInsert(session, item);
       if (hasIndex()) {
-        session.enqueue(new UpsertDto<DTO>(getIndexType(), item));
+        session.enqueue(new UpsertDto<>(getIndexType(), item));
       }
     } catch (Exception e) {
       throw new IllegalStateException("Fail to insert item in db: " + item, e);
@@ -281,7 +281,7 @@ public abstract class BaseDao<MAPPER, DTO extends Dto<KEY>, KEY extends Serializ
     try {
       doDeleteByKey(session, key);
       if (hasIndex()) {
-        session.enqueue(new DeleteKey<KEY>(getIndexType(), key));
+        session.enqueue(new DeleteKey<>(getIndexType(), key));
       }
     } catch (Exception e) {
       throw new IllegalStateException("Fail to delete item from db: " + key, e);
@@ -290,14 +290,14 @@ public abstract class BaseDao<MAPPER, DTO extends Dto<KEY>, KEY extends Serializ
 
   protected final void enqueueUpdate(Object nestedItem, KEY key, DbSession session) {
     if (hasIndex()) {
-      session.enqueue(new UpsertNestedItem<KEY>(
+      session.enqueue(new UpsertNestedItem<>(
         this.getIndexType(), key, nestedItem));
     }
   }
 
   public void enqueueDelete(Object nestedItem, KEY key, DbSession session) {
     if (hasIndex()) {
-      session.enqueue(new DeleteNestedItem<KEY>(
+      session.enqueue(new DeleteNestedItem<>(
         this.getIndexType(), key, nestedItem));
       session.commit();
     }
@@ -329,7 +329,7 @@ public abstract class BaseDao<MAPPER, DTO extends Dto<KEY>, KEY extends Serializ
       public void handleResult(ResultContext resultContext) {
         DTO dto = (DTO) resultContext.getResultObject();
         // session.enqueue(new UpsertDto<DTO>(getIndexType(), dto, false));
-        getSession().enqueue(new InsertDto<DTO>(getIndexType(), dto, false));
+        getSession().enqueue(new InsertDto<>(getIndexType(), dto, false));
         count++;
         if (count % 100000 == 0) {
           LOGGER.info("Synchronized {} {}", count, getIndexType());
index a433b473e4a191ea82514c20ef089cd0a42b09bc..62ad570ded6ded604a81e7da6adcb1e4d7fc1160 100644 (file)
@@ -40,7 +40,7 @@ class SelectImpl extends BaseSqlStatement<Select> implements Select {
     ResultSet rs = pstmt.executeQuery();
     Select.Row row = new Select.Row(rs);
     try {
-      List<T> rows = new ArrayList<T>();
+      List<T> rows = new ArrayList<>();
       while (rs.next()) {
         rows.add(reader.read(row));
       }
index f7ee441c6682ca43a55606b1d2c1ff564e41978e..1bd842ed732e3ffaf74cc03a672f94b468549536 100644 (file)
@@ -109,7 +109,7 @@ class Referentials {
       stmt = connection.createStatement();
       stmt.setFetchSize(10000);
       rs = stmt.executeQuery("select id from rule_failures");
-      Queue<long[]> queue = new ConcurrentLinkedQueue<long[]>();
+      Queue<long[]> queue = new ConcurrentLinkedQueue<>();
 
       totalViolations = 0;
       long[] block = new long[VIOLATION_GROUP_SIZE];
index fc26516b454b58ae1625b13e9f1c288572a7b5bc..1219afd4d924cfbc803c52723c9c659da84db186 100644 (file)
@@ -118,11 +118,11 @@ class FileSourceDto {
   }
 
   private Map<Integer, String> computeDuplicationsPerLine(List<List<Block>> duplicationGroups) {
-    Map<Integer, String> result = new HashMap<Integer, String>();
+    Map<Integer, String> result = new HashMap<>();
     if (duplicationGroups.isEmpty()) {
       return result;
     }
-    Map<Integer, StringBuilder> dupPerLine = new HashMap<Integer, StringBuilder>();
+    Map<Integer, StringBuilder> dupPerLine = new HashMap<>();
     int blockId = 1;
     for (List<Block> group : duplicationGroups) {
       Block originBlock = group.get(0);
index b5768fdec3d45d2813272faf96d2e12f86db7445..e8b8bc7517ea05c55394ce91bf0253cdb5072dee 100644 (file)
@@ -53,8 +53,8 @@ public class NewIndex {
 
   public static class NewIndexType {
     private final String name;
-    private final Map<String, Object> attributes = new TreeMap<String, Object>();
-    private final Map<String, Object> properties = new TreeMap<String, Object>();
+    private final Map<String, Object> attributes = new TreeMap<>();
+    private final Map<String, Object> properties = new TreeMap<>();
 
     private NewIndexType(String typeName) {
       this.name = typeName;
@@ -278,7 +278,7 @@ public class NewIndex {
 
   private final String indexName;
   private final ImmutableSettings.Builder settings = DefaultIndexSettings.defaults();
-  private final SortedMap<String, NewIndexType> types = new TreeMap<String, NewIndexType>();
+  private final SortedMap<String, NewIndexType> types = new TreeMap<>();
 
   NewIndex(String indexName) {
     Preconditions.checkArgument(StringUtils.isAllLowerCase(indexName), "Index name must be lower-case: " + indexName);
index 2dff217866e6ae7fa9fa111fcd26d1a7558ba502..69322f4a9fb9197e40c5dd7733586437f685748b 100644 (file)
@@ -49,7 +49,7 @@ public class IssueBulkChangeQuery {
   private boolean hasComment;
   private boolean sendNotifications;
 
-  Map<String, Map<String, Object>> propertiesByActions = new HashMap<String, Map<String, Object>>();
+  Map<String, Map<String, Object>> propertiesByActions = new HashMap<>();
 
   public IssueBulkChangeQuery(Map<String, Object> props, String comment, boolean sendNotifications) {
     this.sendNotifications = sendNotifications;
index 3f5489fccbfa1190f581ad74b91e36e7b87d0242..206c3bc8a89e808c8f72c25dd890c2621f39f1d0 100644 (file)
@@ -135,7 +135,7 @@ public class IssueService {
       return Collections.emptyList();
     }
     List<Transition> outTransitions = workflow.outTransitions(issue);
-    List<Transition> allowedTransitions = new ArrayList<Transition>();
+    List<Transition> allowedTransitions = new ArrayList<>();
     for (Transition transition : outTransitions) {
       String projectUuid = issue.projectUuid();
       if (StringUtils.isBlank(transition.requiredProjectPermission()) ||
index ccf2c867502c655be3172b968c2f849e5cabd9c8..cf7bd8bfd7dcf0bc0ad26ac2567f2baf7a435b42 100644 (file)
@@ -42,7 +42,7 @@ public class Result<T> {
   }
 
   public static <T> Result<T> of() {
-    return new Result<T>(null);
+    return new Result<>(null);
   }
 
   public Result<T> set(@Nullable T object) {
index e7710b9019bd66a701eab0b1037e2e7a418557c3..4d3f4ffa20187e0a5932c9eaa2de9c91b6547333 100644 (file)
@@ -69,7 +69,7 @@ public class QProfileExporters {
   }
 
   public List<ProfileExporter> exportersForLanguage(String language) {
-    List<ProfileExporter> result = new ArrayList<ProfileExporter>();
+    List<ProfileExporter> result = new ArrayList<>();
     for (ProfileExporter exporter : exporters) {
       if (exporter.getSupportedLanguages() == null || exporter.getSupportedLanguages().length == 0 || ArrayUtils.contains(exporter.getSupportedLanguages(), language)) {
         result.add(exporter);
@@ -127,7 +127,7 @@ public class QProfileExporters {
    * Used by rails
    */
   public List<ProfileImporter> findProfileImportersForLanguage(String language) {
-    List<ProfileImporter> result = new ArrayList<ProfileImporter>();
+    List<ProfileImporter> result = new ArrayList<>();
     for (ProfileImporter importer : importers) {
       if (importer.getSupportedLanguages() == null || importer.getSupportedLanguages().length == 0 || ArrayUtils.contains(importer.getSupportedLanguages(), language)) {
         result.add(importer);
index 6670519ec30a5a627ee247a40c238ac974af4807..38a652bead94c8dfee6478c5a5d8313590bc8898 100644 (file)
@@ -107,7 +107,7 @@ public class QProfileLoader {
   }
 
   public Map<String, Long> countAllActiveRules() {
-    Map<String, Long> counts = new HashMap<String, Long>();
+    Map<String, Long> counts = new HashMap<>();
     for (Map.Entry<String, Long> entry : index.get(ActiveRuleIndex.class).countAllByQualityProfileKey().entrySet()) {
       counts.put(entry.getKey(), entry.getValue());
     }
index 98e708ec3f1e786bf29f233f03677120e088aab0..56ab441ac67434bb6e33274ad1e35ad276d89653 100644 (file)
@@ -218,7 +218,7 @@ public class QProfileService {
     DbSession session = db.openSession(false);
     try {
       SearchResponse response = activityIndex.doSearch(query, options);
-      Result<QProfileActivity> result = new Result<QProfileActivity>(response);
+      Result<QProfileActivity> result = new Result<>(response);
       for (SearchHit hit : response.getHits().getHits()) {
         QProfileActivity profileActivity = new QProfileActivity(hit.getSource());
         RuleDto ruleDto = db.ruleDao().getNullableByKey(session, profileActivity.ruleKey());
index 66048c8ba45caab579a974058bea2c376a1df6be..239e0e7b753a8439e0475fa7860f339dc6e07c05 100644 (file)
@@ -88,7 +88,7 @@ public class ActiveRuleDoc extends BaseDoc implements ActiveRule {
 
   @Override
   public Map<String, String> params() {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     List<Map<String, String>> allParams = getNullableField(ActiveRuleNormalizer.ActiveRuleField.PARAMS.field());
     if (allParams != null) {
       for (Map<String, String> param : allParams) {
index ff5892613e674a125778d955859009540627334c..b2af81656a8d5c37b36318e5f9b1a87d22576fe9 100644 (file)
@@ -64,14 +64,14 @@ public class ActiveRuleIndex extends BaseIndex<ActiveRule, ActiveRuleDto, Active
 
   @Override
   protected Map mapKey() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("path", ActiveRuleNormalizer.ActiveRuleField.KEY.field());
     return mapping;
   }
 
   @Override
   protected Map mapProperties() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     for (IndexField field : ActiveRuleNormalizer.ActiveRuleField.ALL_FIELDS) {
       mapping.put(field.field(), mapField(field));
     }
@@ -80,7 +80,7 @@ public class ActiveRuleIndex extends BaseIndex<ActiveRule, ActiveRuleDto, Active
 
   @Override
   protected Map mapDomain() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("dynamic", false);
     mapping.put("_id", mapKey());
     mapping.put("_parent", mapParent());
@@ -90,14 +90,14 @@ public class ActiveRuleIndex extends BaseIndex<ActiveRule, ActiveRuleDto, Active
   }
 
   private Map mapRouting() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("required", true);
     mapping.put("path", ActiveRuleNormalizer.ActiveRuleField.RULE_KEY.field());
     return mapping;
   }
 
   private Object mapParent() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("type", this.getParentType());
     return mapping;
   }
@@ -123,7 +123,7 @@ public class ActiveRuleIndex extends BaseIndex<ActiveRule, ActiveRuleDto, Active
 
     SearchResponse response = request.get();
 
-    List<ActiveRule> activeRules = new ArrayList<ActiveRule>();
+    List<ActiveRule> activeRules = new ArrayList<>();
     for (SearchHit hit : response.getHits()) {
       activeRules.add(toDoc(hit.getSource()));
     }
@@ -185,7 +185,7 @@ public class ActiveRuleIndex extends BaseIndex<ActiveRule, ActiveRuleDto, Active
       .setSize(0)
       .setTypes(this.getIndexType());
     SearchResponse response = request.get();
-    Map<String, Multimap<String, FacetValue>> stats = new HashMap<String, Multimap<String, FacetValue>>();
+    Map<String, Multimap<String, FacetValue>> stats = new HashMap<>();
     Aggregation aggregation = response.getAggregations().get(ActiveRuleNormalizer.ActiveRuleField.PROFILE_KEY.field());
     for (Terms.Bucket value : ((Terms) aggregation).getBuckets()) {
       stats.put(value.getKey()
index 335991d4448956c2866705600c81e7a55159dd31..93a4f52504981f3046055589642fd45814dac056 100644 (file)
@@ -74,12 +74,12 @@ public class ActiveRuleNormalizer extends BaseNormalizer<ActiveRuleDto, ActiveRu
   @Override
   public List<UpdateRequest> normalize(ActiveRuleDto activeRuleDto) {
 
-    List<UpdateRequest> requests = new ArrayList<UpdateRequest>();
+    List<UpdateRequest> requests = new ArrayList<>();
 
     ActiveRuleKey key = activeRuleDto.getKey();
     Preconditions.checkArgument(key != null, "Cannot normalize ActiveRuleDto with null key");
 
-    Map<String, Object> newRule = new HashMap<String, Object>();
+    Map<String, Object> newRule = new HashMap<>();
     newRule.put("_parent", key.ruleKey().toString());
     newRule.put(ActiveRuleField.RULE_KEY.field(), key.ruleKey().toString());
     newRule.put(ActiveRuleField.KEY.field(), key.toString());
@@ -157,7 +157,7 @@ public class ActiveRuleNormalizer extends BaseNormalizer<ActiveRuleDto, ActiveRu
   private List<UpdateRequest> nestedUpdate(ActiveRuleParamDto param, ActiveRuleKey key) {
     Preconditions.checkArgument(key != null, "Cannot normalize ActiveRuleParamDto for null key of ActiveRule");
 
-    Map<String, Object> newParam = new HashMap<String, Object>();
+    Map<String, Object> newParam = new HashMap<>();
     newParam.put(ActiveRuleParamField.NAME.field(), param.getKey());
     newParam.put(ActiveRuleParamField.VALUE.field(), param.getValue());
 
index 50d9ed6c4d978bd79c430cf57bafea69a3d68b87..04f2b73385ba671c9f4641a6bed2ee6385e5e508 100644 (file)
@@ -117,7 +117,7 @@ public class QProfileChangelogAction implements BaseQProfileWsAction {
     DbSession session = dbClient.openSession(false);
     try {
       SearchResponse response = activityIndex.doSearch(query, options);
-      Result<QProfileActivity> result = new Result<QProfileActivity>(response);
+      Result<QProfileActivity> result = new Result<>(response);
       for (SearchHit hit : response.getHits().getHits()) {
         QProfileActivity profileActivity = new QProfileActivity(hit.getSource());
         RuleDto ruleDto = dbClient.ruleDao().getNullableByKey(session, profileActivity.ruleKey());
index 674e9cade109469341443e78cfc1d5956623db85..d17ef7ef29bab2d4e1d39607e0c6be039b28412a 100644 (file)
@@ -144,7 +144,7 @@ public class RegisterRules implements Startable {
   }
 
   private Map<RuleKey, RuleDto> loadRules(DbSession session) {
-    Map<RuleKey, RuleDto> rules = new HashMap<RuleKey, RuleDto>();
+    Map<RuleKey, RuleDto> rules = new HashMap<>();
     for (RuleDto rule : dbClient.ruleDao().findByNonManual(session)) {
       rules.put(rule.getKey(), rule);
     }
@@ -152,7 +152,7 @@ public class RegisterRules implements Startable {
   }
 
   private Map<String, CharacteristicDto> loadCharacteristics(DbSession session) {
-    Map<String, CharacteristicDto> characteristics = new HashMap<String, CharacteristicDto>();
+    Map<String, CharacteristicDto> characteristics = new HashMap<>();
     for (CharacteristicDto characteristicDto : characteristicDao.selectEnabledCharacteristics(session)) {
       characteristics.put(characteristicDto.getKey(), characteristicDto);
     }
@@ -182,7 +182,7 @@ public class RegisterRules implements Startable {
   }
 
   private List<RulesDefinition.ExtendedRepository> getRepositories(RulesDefinition.Context context) {
-    List<RulesDefinition.ExtendedRepository> repositories = new ArrayList<RulesDefinition.ExtendedRepository>();
+    List<RulesDefinition.ExtendedRepository> repositories = new ArrayList<>();
     for (RulesDefinition.Repository repoDef : context.repositories()) {
       repositories.add(repoDef);
     }
index 3c9de11535b0e2baef45c8b5b20a588525598a1d..c1f90ed185e2fdf2b439b9eb5cd6b0358f1780f8 100644 (file)
@@ -141,7 +141,7 @@ public class RuleDoc extends BaseDoc implements Rule {
 
   @Override
   public List<RuleParam> params() {
-    List<RuleParam> params = new ArrayList<RuleParam>();
+    List<RuleParam> params = new ArrayList<>();
     final List<Map<String, Object>> esParams = getNullableField(RuleNormalizer.RuleField.PARAMS.field());
     if (esParams != null) {
       for (final Map<String, Object> esParam : esParams) {
index 2eaa52be4927fe22ef14dd73125255a2c657627f..4562695bb3b1ec357d329a23f9560eed2cf586a8 100644 (file)
@@ -99,14 +99,14 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
 
   @Override
   protected Map mapKey() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("path", RuleNormalizer.RuleField.KEY.field());
     return mapping;
   }
 
   @Override
   protected Map mapProperties() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     for (IndexField field : RuleNormalizer.RuleField.ALL_FIELDS) {
       mapping.put(field.field(), mapField(field));
     }
@@ -115,7 +115,7 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
 
   private void setFields(QueryContext options, SearchRequestBuilder esSearch) {
     /* integrate Option's Fields */
-    Set<String> fields = new HashSet<String>();
+    Set<String> fields = new HashSet<>();
     if (!options.getFieldsToReturn().isEmpty()) {
       for (String fieldToReturn : options.getFieldsToReturn()) {
         if (!fieldToReturn.isEmpty()) {
@@ -210,7 +210,7 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
   /* Build main filter (match based) */
   protected Map<String, FilterBuilder> getFilters(RuleQuery query, QueryContext options) {
 
-    Map<String, FilterBuilder> filters = new HashMap<String, FilterBuilder>();
+    Map<String, FilterBuilder> filters = new HashMap<>();
 
     /* Add enforced filter on rules that are REMOVED */
     filters.put(RuleNormalizer.RuleField.STATUS.field(),
@@ -300,7 +300,7 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
 
     Collection<RuleStatus> statusValues = query.getStatuses();
     if (statusValues != null && !statusValues.isEmpty()) {
-      Collection<String> stringStatus = new ArrayList<String>();
+      Collection<String> stringStatus = new ArrayList<>();
       for (RuleStatus status : statusValues) {
         stringStatus.add(status.name());
       }
@@ -350,7 +350,7 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
   }
 
   protected Map<String, AggregationBuilder> getFacets(RuleQuery query, QueryContext options, QueryBuilder queryBuilder, Map<String, FilterBuilder> filters) {
-    Map<String, AggregationBuilder> aggregations = new HashMap<String, AggregationBuilder>();
+    Map<String, AggregationBuilder> aggregations = new HashMap<>();
     StickyFacetBuilder stickyFacetBuilder = stickyFacetBuilder(queryBuilder, filters);
 
     addDefaultFacets(query, options, queryBuilder, filters, aggregations, stickyFacetBuilder);
@@ -528,7 +528,7 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
 
     esSearch.setQuery(QueryBuilders.filteredQuery(qb, fb));
     SearchResponse esResult = esSearch.get();
-    return new Result<Rule>(this, esResult);
+    return new Result<>(this, esResult);
   }
 
   @Override
@@ -542,7 +542,7 @@ public class RuleIndex extends BaseIndex<Rule, RuleDto, RuleKey> {
   }
 
   public Set<String> terms(String fields, @Nullable String query, int size) {
-    Set<String> tags = new HashSet<String>();
+    Set<String> tags = new HashSet<>();
     String key = "_ref";
 
     TermsBuilder terms = AggregationBuilders.terms(key)
index a9d5d828428d51a62adc9324c4c8b4dab8943156..9452b8a62a4d1bb16ca45e83b17e739a6d8b384c 100644 (file)
@@ -136,13 +136,13 @@ public class RuleNormalizer extends BaseNormalizer<RuleDto, RuleKey> {
   @Override
   public List<UpdateRequest> normalize(RuleDto rule) {
 
-    List<UpdateRequest> requests = new ArrayList<UpdateRequest>();
+    List<UpdateRequest> requests = new ArrayList<>();
 
     DbSession session = db.openSession(false);
     try {
 
       /** Update Fields */
-      Map<String, Object> update = new HashMap<String, Object>();
+      Map<String, Object> update = new HashMap<>();
 
       update.put(RuleField.ID.field(), rule.getId());
 
@@ -314,7 +314,7 @@ public class RuleNormalizer extends BaseNormalizer<RuleDto, RuleKey> {
   }
 
   private List<UpdateRequest> nestedUpdate(RuleParamDto param, RuleKey key) {
-    Map<String, Object> newParam = new HashMap<String, Object>();
+    Map<String, Object> newParam = new HashMap<>();
     newParam.put(RuleParamField.NAME.field(), param.getName());
     newParam.put(RuleParamField.TYPE.field(), param.getType());
     newParam.put(RuleParamField.DESCRIPTION.field(), param.getDescription());
index 65d82a82998ababa075fdaf0eacdff439932b0be..3b2c1cdc0c64ae4e9c76e6082f8dfc92c9a2da0c 100644 (file)
@@ -234,7 +234,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
   protected abstract Map mapKey();
 
   protected Map mapDomain() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("dynamic", false);
     mapping.put("_all", ImmutableMap.of("enabled", false));
     if (mapKey() != null) {
@@ -297,10 +297,10 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
   }
 
   protected Map mapNestedField(IndexField field) {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("type", "nested");
     mapping.put("dynamic", "true");
-    Map<String, Object> mappings = new HashMap<String, Object>();
+    Map<String, Object> mappings = new HashMap<>();
     for (IndexField nestedField : field.nestedFields()) {
       if (nestedField != null) {
         mappings.put(nestedField.field(), mapField(nestedField));
@@ -339,7 +339,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
   }
 
   protected Map mapMultiField(IndexField field) {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     if (field.isSortable()) {
       mapping.put(IndexField.SORT_SUFFIX, ImmutableMap.of(
         "type", "string",
@@ -357,7 +357,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
   }
 
   protected Map mapStringField(IndexField field, boolean allowRecursive) {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     // check if the field needs to be MultiField
     if (allowRecursive && needMultiField(field)) {
       mapping.put("type", "multi_field");
@@ -372,7 +372,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
   }
 
   protected Map mapTextField(IndexField field, boolean allowRecursive) {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     // check if the field needs to be MultiField
     if (allowRecursive && needMultiField(field)) {
       mapping.put("type", "multi_field");
@@ -420,7 +420,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
     if (keys.isEmpty()) {
       return Collections.emptyList();
     }
-    List<DOMAIN> results = new ArrayList<DOMAIN>();
+    List<DOMAIN> results = new ArrayList<>();
     MultiGetRequestBuilder request = client.prepareMultiGet()
       .setPreference("_local");
     for (KEY key : keys) {
@@ -474,7 +474,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
   }
 
   public Map<String, Long> countByField(IndexField indexField, FilterBuilder filter) {
-    Map<String, Long> counts = new HashMap<String, Long>();
+    Map<String, Long> counts = new HashMap<>();
 
     SearchRequestBuilder request = client.prepareSearch(this.getIndexName())
       .setTypes(this.getIndexType())
index 5d9b819bfcab1a8202b913b5f30c320fbc3a5c14..34b412fedcd4baec10d5a97a7beadd760fc05259 100644 (file)
@@ -41,7 +41,7 @@ public abstract class BaseNormalizer<DTO extends Dto<KEY>, KEY extends Serializa
   }
 
   protected Map<String, Object> getUpsertFor(Set<IndexField> fields, Map<String, Object> update) {
-    Map<String, Object> upsert = new HashMap<String, Object>(update);
+    Map<String, Object> upsert = new HashMap<>(update);
     for (IndexField field : fields) {
       if (!upsert.containsKey(field.field())) {
         if (field.type().equals(IndexField.Type.OBJECT)) {
index 7f94bd314f56bc100a280ae5621d1df643be981e..d8441db4679b1bb5ae2395454ae5921d6804c5a9 100644 (file)
@@ -112,7 +112,7 @@ class Facets {
   }
 
   public List<String> getFacetKeys(String facetName) {
-    List<String> keys = new ArrayList<String>();
+    List<String> keys = new ArrayList<>();
     if (this.facetValues.containsKey(facetName)) {
       for (FacetValue facetValue : facetValues.get(facetName)) {
         keys.add(facetValue.getKey());
index 89a2b3d40d2bc987ff379f7877ed0fb9d4a6820f..882b5af4c600ac96078157aa9b4040c3bafdb0b3 100644 (file)
@@ -35,7 +35,7 @@ public class IndexClient {
 
   public IndexClient(Index<?, ?, ?>... indexComponents) {
 
-    this.indexComponents = new HashMap<Class<?>, Index<?, ?, ?>>();
+    this.indexComponents = new HashMap<>();
 
     for (Index<?, ?, ?> indexComponent : indexComponents) {
       this.indexComponents.put(indexComponent.getClass(), indexComponent);
index 9d244062923044f9a1fea85dbe4bae97d05fa5a6..441569fbdb6fe566db21ea20fdfa085c6a66e4d5 100644 (file)
@@ -68,7 +68,7 @@ public class IndexQueue implements WorkQueue<IndexAction<?>> {
     boolean refreshRequired = false;
 
     Map<String, Index> indexes = getIndexMap();
-    Set<String> indices = new HashSet<String>();
+    Set<String> indices = new HashSet<>();
     for (IndexAction action : actions) {
       Index index = indexes.get(action.getIndexType());
       action.setIndex(index);
@@ -139,7 +139,7 @@ public class IndexQueue implements WorkQueue<IndexAction<?>> {
   }
 
   private Map<String, Index> getIndexMap() {
-    Map<String, Index> indexes = new HashMap<String, Index>();
+    Map<String, Index> indexes = new HashMap<>();
     for (Index index : container.getComponentsByType(Index.class)) {
       indexes.put(index.getIndexType(), index);
     }
index 55b6faa6e7325a0df445992949994eb5550a35a6..ee2901cdf7a0dee45e6d50cc4860966f3172ab63 100644 (file)
@@ -46,7 +46,7 @@ public class Result<K> {
     this.scrollId = response.getScrollId();
     this.facets = new Facets(response);
     this.total = (int) response.getHits().totalHits();
-    this.hits = new ArrayList<K>();
+    this.hits = new ArrayList<>();
     if (index != null) {
       for (SearchHit hit : response.getHits()) {
         this.hits.add(index.toDoc(hit.getSource()));
index da01dd568c4c7d8fc7dce3724413f40f4855bcbf..4c2b53ac05c6b7ed19d92677d128342fe55267ff 100644 (file)
@@ -43,7 +43,7 @@ public class DeleteKey<K extends Serializable> extends IndexAction<DeleteRequest
 
   @Override
   public List<DeleteRequest> doCall(Index index) {
-    List<DeleteRequest> requests = new ArrayList<DeleteRequest>();
+    List<DeleteRequest> requests = new ArrayList<>();
     requests.add(Requests.deleteRequest(index.getIndexName())
       .id(getKey())
       .type(indexType)
index cebe2828083cb8a03b48b5e1f72fdaba8aa6bcc9..4b7453f32382da00a6ec5c8506de27ab9eea9d46 100644 (file)
@@ -46,7 +46,7 @@ public class DeleteNestedItem<K extends Serializable> extends IndexAction<Update
 
   @Override
   public List<UpdateRequest> doCall(Index index) {
-    List<UpdateRequest> updates = new ArrayList<UpdateRequest>();
+    List<UpdateRequest> updates = new ArrayList<>();
     updates.addAll(deleteItem(index, item, key));
     for (Object otherItem : items) {
       updates.addAll(deleteItem(index, otherItem, key));
index 467272b2cb25821b68eb21cb18d1bca564097108..45576708131198d2f7df365910b0fcba2bfacb26 100644 (file)
@@ -43,7 +43,7 @@ public class InsertDto<DTO extends Dto> extends IndexAction<ActionRequest> {
 
   @Override
   public List<ActionRequest> doCall(Index index) {
-    List<ActionRequest> inserts = new ArrayList<ActionRequest>();
+    List<ActionRequest> inserts = new ArrayList<>();
     List<UpdateRequest> updates = index.getNormalizer().normalize(dto);
     for (UpdateRequest update : updates) {
       if (update.doc() != null) {
index a1029e3913652a438651c4f198f116f20c8ab844..fcf3a6ac36e6ca45d66f79d483ec1aad87352171 100644 (file)
@@ -46,7 +46,7 @@ public class UpsertNestedItem<K extends Serializable> extends IndexAction<Update
 
   @Override
   public List<UpdateRequest> doCall(Index index) {
-    List<UpdateRequest> updates = new ArrayList<UpdateRequest>();
+    List<UpdateRequest> updates = new ArrayList<>();
     updates.addAll(normalizeItem(index, item, key));
     for (Object otherItem : items) {
       updates.addAll(normalizeItem(index, otherItem, key));
index fcb680afe28199e848435dac88fee50b7ab4b859..457b460705c6cce5de8a17503a80b52c3b956398 100644 (file)
@@ -40,7 +40,7 @@ class CharactersReader {
 
   public CharactersReader(BufferedReader stringBuffer) {
     this.stringBuffer = stringBuffer;
-    this.openTags = new ArrayDeque<String>();
+    this.openTags = new ArrayDeque<>();
   }
 
   boolean readNextChar() throws IOException {
index 14c602321715b0c9e818406f5e2d62f7e8cc7a4f..bb756359466c7a4ec4821d7bd0babda84e51e509 100644 (file)
@@ -110,7 +110,7 @@ public class BarChartTest extends BaseChartWebTest {
 
   @Test
   public void testStackedBarCharteightyTwenty() throws IOException {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.STACKED_BAR_CHART);
     params.put(BaseChartWeb.CHART_PARAM_VALUES, "80,20");
     BarChart chart = new BarChart(params);
@@ -121,7 +121,7 @@ public class BarChartTest extends BaseChartWebTest {
 
   @Test
   public void testStackedBarChartfiftyFifty() throws IOException {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.STACKED_BAR_CHART);
     params.put(BaseChartWeb.CHART_PARAM_VALUES, "50,50");
     BarChart chart = new BarChart(params);
@@ -131,7 +131,7 @@ public class BarChartTest extends BaseChartWebTest {
   }
 
   private Map<String, String> getDefaultParams() {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.BAR_CHART_HORIZONTAL);
     params.put(BaseChartWeb.CHART_PARAM_VALUES, "100,50");
     return params;
index 3ba7eacc440c58a578fb566b96d9c5482751245c..2046beb7043585a7572bf7ccd1d5d4102b3bcaad 100644 (file)
@@ -30,7 +30,7 @@ public class CustomBarChartTest extends BaseChartWebTest {
 
   @Test
   public void testEmptyParameters() throws IOException {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     CustomBarChart chart = new CustomBarChart(params);
     BufferedImage img = chart.getChartImage();
     saveChart(img, "custom-horizontal-bar-chart-empty.png");
@@ -81,7 +81,7 @@ public class CustomBarChartTest extends BaseChartWebTest {
   }
 
   private Map<String, String> getDefaultParams() {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.BAR_CHART_HORIZONTAL);
     params.put(BaseChartWeb.CHART_PARAM_VALUES, "100,50");
     return params;
index 863d2e7f7fe8cde5977555cf6212b4c1be803e4e..afaf2ba67100813a7020875a057770aa9271f119 100644 (file)
@@ -99,7 +99,7 @@ public class PieChartTest extends BaseChartWebTest {
   }
 
   private Map<String, String> getDefaultParams() {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.PIE_CHART);
     params.put(BaseChartWeb.CHART_PARAM_VALUES, "100,50");
     params.put(BaseChartWeb.CHART_PARAM_DIMENSIONS, "50x50");
index 2ebee6fde29c170893c5b268dcbef53bc3152ad6..15ddb7878bdaa255d457e9bdc7890e464aa35d91 100644 (file)
@@ -110,7 +110,7 @@ public class SparkLinesChartTest extends BaseChartWebTest {
   }
 
   private Map<String, String> getDefaultParams() {
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put(BaseChartWeb.CHART_PARAM_TYPE, BaseChartWeb.SPARKLINES_CHART);
     params.put(BaseChartWeb.CHART_PARAM_VALUES, "1,1,2,4,3,3,4,5,5,5,6,7,7,7,8,8");
     return params;
index 339a8b6672d8f71abb67a04c751c8fc99daf5254..38e9edd51d6f5a1269422b7751449c53686494c1 100644 (file)
@@ -78,7 +78,7 @@ public class BaseDataChangeTest extends AbstractDaoTestCase {
   public void read_column_types() throws Exception {
     db.prepareDbUnit(getClass(), "persons.xml");
 
-    final List<Object[]> persons = new ArrayList<Object[]>();
+    final List<Object[]> persons = new ArrayList<>();
     new BaseDataChange(db.database()) {
       @Override
       public void execute(Context context) throws SQLException {
@@ -100,7 +100,7 @@ public class BaseDataChangeTest extends AbstractDaoTestCase {
   public void parameterized_query() throws Exception {
     db.prepareDbUnit(getClass(), "persons.xml");
 
-    final List<Long> ids = new ArrayList<Long>();
+    final List<Long> ids = new ArrayList<>();
     new BaseDataChange(db.database()) {
       @Override
       public void execute(Context context) throws SQLException {
@@ -156,7 +156,7 @@ public class BaseDataChangeTest extends AbstractDaoTestCase {
   public void bad_parameterized_query() throws Exception {
     db.prepareDbUnit(getClass(), "persons.xml");
 
-    final List<Long> ids = new ArrayList<Long>();
+    final List<Long> ids = new ArrayList<>();
     BaseDataChange change = new BaseDataChange(db.database()) {
       @Override
       public void execute(Context context) throws SQLException {
@@ -174,7 +174,7 @@ public class BaseDataChangeTest extends AbstractDaoTestCase {
   public void scroll() throws Exception {
     db.prepareDbUnit(getClass(), "persons.xml");
 
-    final List<Long> ids = new ArrayList<Long>();
+    final List<Long> ids = new ArrayList<>();
     new BaseDataChange(db.database()) {
       @Override
       public void execute(Context context) throws SQLException {
@@ -435,7 +435,7 @@ public class BaseDataChangeTest extends AbstractDaoTestCase {
   public void read_not_null_fields() throws Exception {
     db.prepareDbUnit(getClass(), "persons.xml");
 
-    final List<Object[]> persons = new ArrayList<Object[]>();
+    final List<Object[]> persons = new ArrayList<>();
     new BaseDataChange(db.database()) {
       @Override
       public void execute(Context context) throws SQLException {
index e9639abe0c0766c52ed683f91fb3043de3addff8..3cf9f9e373f0dd6caaf1ce691ab79eb0628c7f30 100644 (file)
@@ -117,7 +117,7 @@ public class ProxyPutMappingRequestBuilderTest {
   }
 
   protected static Map mapDomain() {
-    Map<String, Object> mapping = new HashMap<String, Object>();
+    Map<String, Object> mapping = new HashMap<>();
     mapping.put("dynamic", false);
     mapping.put("_all", ImmutableMap.of("enabled", false));
     return mapping;
index a518646c6f9eefd5cea20af3bbe52cf1d6baa8d9..a9793c9a594474c4e3727fbe5144338bce23db6a 100644 (file)
@@ -1093,7 +1093,7 @@ public class RuleIndexMediumTest {
 
   @Test
   public void scroll_byIds() {
-    Set<Integer> ids = new HashSet<Integer>();
+    Set<Integer> ids = new HashSet<>();
     for (int i = 0; i < 150; i++) {
       RuleDto rule = RuleTesting.newDto(RuleKey.of("scroll", "r_" + i));
       dao.insert(dbSession, rule);
index 13a654ce7f5325ddf02d528cf6a2586e76553e5c..d04d991ae254924fda517387572a1875c43c69c3 100644 (file)
@@ -47,7 +47,7 @@ public class DeleteKeyTest {
   @Test
   public void get_delete_request() {
     String key = "test_key";
-    DeleteKey<String> deleteAction = new DeleteKey<String>(TEST_INDEX.getIndexType(), key);
+    DeleteKey<String> deleteAction = new DeleteKey<>(TEST_INDEX.getIndexType(), key);
 
     try {
       deleteAction.call();
index bd97afb9ad405faa4e39e1b60924ffb763fc6942..498a4c00cc53eef2691fa7bd2e4a00160ebc8cb7 100644 (file)
@@ -199,7 +199,7 @@ public class SonarClient {
       throw new IllegalArgumentException(String.format(
         "Expecting even number of elements. Got %s", Arrays.toString(params)));
     }
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
     for (int index = 0; index < params.length; index++) {
       if (params[index] == null) {
         throw new IllegalArgumentException(String.format(
index 8516b2936340dca87c2ee78dd756921bef87cc31..31110650d8ff29c004c64a040ddddd96b9ee0fdd 100644 (file)
@@ -40,7 +40,7 @@ public class EncodingUtils {
     if (array.length%2==1) {
       throw new IllegalArgumentException("Not an even number of arguments");
     }
-    Map<String, Object> map = new LinkedHashMap<String, Object>();
+    Map<String, Object> map = new LinkedHashMap<>();
     for (int i = 0; i < array.length; i += 2) {
       Object value = array[i + 1];
       if (value != null) {
index 8a2db77625097cac36e686bba08f16995327928f..b4a35dcdd222aa89cb2f958f2bec6c28845c08ae 100644 (file)
@@ -29,7 +29,7 @@ public class ActionPlanQuery {
 
   public static final String BASE_URL = "/api/action_plans/search";
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private ActionPlanQuery() {
   }
index db43ec72c5429823eb1560857086f56caa203ac4..1e9955fe43b2dd32f873160c9c12fb74c6e91e04 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Map;
  */
 public class BulkChangeQuery {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private BulkChangeQuery() {
   }
index b9ffe11ea50d0e6f46c093ddab31f2db49e2178d..ba8878cb5f9ba16eb1cf1ebdd583881cb0dd3a18 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map;
  */
 public class IssueQuery {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private IssueQuery() {
   }
index 015efe48e532ebef2f689d2789195a6c9048aab1..b25476ff656d0b4a7d71d7607c1b165425484ffc 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map;
  */
 public class NewActionPlan {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private NewActionPlan() {
   }
index 6e8dcb441ec9e1214596dc9492f99a1be62c2969..2eab384d225e1db3421459f70ef7ff40bcaf73bb 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Map;
  */
 public class NewIssue {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private NewIssue() {
   }
index 506132892deb4d204d634d16bc93714540d09b3c..80bf4ece77f2067a16deb25502e16938e0dc3511 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map;
  */
 public class UpdateActionPlan {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private UpdateActionPlan() {
   }
index a9bbd61d3f302c996e5c1706c754969e22eb8c9c..6820982c25008f71e5b4ae4680d2b4141857dc00 100644 (file)
@@ -45,7 +45,7 @@ public class DefaultActionPlanClient implements ActionPlanClient {
   @Override
   public List<ActionPlan> find(String projectKey) {
     String json = requestFactory.get(ActionPlanQuery.BASE_URL, EncodingUtils.toMap("project", projectKey));
-    List<ActionPlan> result = new ArrayList<ActionPlan>();
+    List<ActionPlan> result = new ArrayList<>();
     Map jsonRoot = (Map) JSONValue.parse(json);
     List<Map> jsonActionPlans = (List<Map>) jsonRoot.get("actionPlans");
     if (jsonActionPlans != null) {
index 62f9c9562c7c07bb7675eb7d6d955f45cd226ff5..9e51a565b14bf6f4adc0de53b0de8d11e0aaab51 100644 (file)
@@ -34,7 +34,7 @@ public class DefaultBulkChange implements BulkChange {
 
   private Integer totalIssuesChanged;
   private Integer totalIssuesNotChanged;
-  private final List<String> issuesNotChangedKeys = new ArrayList<String>();
+  private final List<String> issuesNotChangedKeys = new ArrayList<>();
 
   @Override
   public List<String> issuesNotChangedKeys() {
index 4492c919ab58d148f06ac88e743024ff3e04b278..7bbc8f8ee5f75368ddd867f0e914eed6d4d2d021 100644 (file)
@@ -169,7 +169,7 @@ public class DefaultIssue implements Issue {
    */
   @Override
   public List<IssueComment> comments() {
-    List<IssueComment> comments = new ArrayList<IssueComment>();
+    List<IssueComment> comments = new ArrayList<>();
     List<Map> jsonComments = (List<Map>) json.get("comments");
     if (jsonComments != null) {
       for (Map jsonComment : jsonComments) {
index b7e7ecf66260c19ffca1384e2cf8fac46c52e9c3..dacd93cc17ea7608bc1769c5ea7a8aed7dd98df1 100644 (file)
@@ -51,7 +51,7 @@ public class DefaultIssueChange implements IssueChange {
 
   @Override
   public List<IssueChangeDiff> diffs() {
-    List<IssueChangeDiff> diffs = new ArrayList<IssueChangeDiff>();
+    List<IssueChangeDiff> diffs = new ArrayList<>();
     List<Map> jsonDiffs = (List<Map>) json.get("diffs");
     for (Map jsonDiff : jsonDiffs) {
       diffs.add(new DefaultIssueChangeDiff(jsonDiff));
index 5f89a1a32bd52e811c9ef7f3935f825bc288452d..524d7b5d678fa2190ffa2094972f7ea9dc2efcc7 100644 (file)
@@ -39,13 +39,13 @@ import java.util.Map;
  */
 public class DefaultIssues implements Issues {
 
-  private final List<Issue> list = new ArrayList<Issue>();
-  private final Map<String, Rule> rulesByKey = new HashMap<String, Rule>();
-  private final Map<String, User> usersByKey = new HashMap<String, User>();
-  private final Map<Long, Component> componentsById = new HashMap<Long, Component>();
-  private final Map<String, Component> componentsByKey = new HashMap<String, Component>();
-  private final Map<String, Component> projectsByKey = new HashMap<String, Component>();
-  private final Map<String, ActionPlan> actionPlansByKey = new HashMap<String, ActionPlan>();
+  private final List<Issue> list = new ArrayList<>();
+  private final Map<String, Rule> rulesByKey = new HashMap<>();
+  private final Map<String, User> usersByKey = new HashMap<>();
+  private final Map<Long, Component> componentsById = new HashMap<>();
+  private final Map<String, Component> componentsByKey = new HashMap<>();
+  private final Map<String, Component> projectsByKey = new HashMap<>();
+  private final Map<String, ActionPlan> actionPlansByKey = new HashMap<>();
   private Paging paging;
 
   @Override
index 02cad915e570879ac8394d4315b37f29b3d9dd55..3ce006dec67ed53238ff08d120eed45cf38faecb 100644 (file)
@@ -111,7 +111,7 @@ public class IssueJsonParser {
   }
 
   List<String> parseTransitions(String json) {
-    List<String> transitions = new ArrayList<String>();
+    List<String> transitions = new ArrayList<>();
     Map jRoot = (Map) JSONValue.parse(json);
     List<String> jTransitions = (List<String>) jRoot.get("transitions");
     for (String jTransition : jTransitions) {
@@ -121,7 +121,7 @@ public class IssueJsonParser {
   }
 
   List<IssueChange> parseChangelog(String json) {
-    List<IssueChange> changes = new ArrayList<IssueChange>();
+    List<IssueChange> changes = new ArrayList<>();
     Map jRoot = (Map) JSONValue.parse(json);
     List<Map> jChanges = (List<Map>) jRoot.get("changelog");
     if (jChanges != null) {
@@ -133,7 +133,7 @@ public class IssueJsonParser {
   }
 
   List<String> parseActions(String json) {
-    List<String> actions = new ArrayList<String>();
+    List<String> actions = new ArrayList<>();
     Map jRoot = (Map) JSONValue.parse(json);
     List<String> jActions = (List<String>) jRoot.get("actions");
     for (String jAction : jActions) {
index 8965152a81b178faabce08fa7a546462cea66847..dcd2dec76f770fc3a5d096c6df6adbbe47a0181c 100644 (file)
@@ -28,7 +28,7 @@ public class PermissionParameters {
   private final Map<String, Object> params;
 
   private PermissionParameters(){
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
   }
 
   public static PermissionParameters create() {
index 740ba8219c75ff0098ceba28dda7d8d186a09dd8..1aa5bff79ccee0acec3f9b79123cbdadf75fc5d2 100644 (file)
@@ -30,7 +30,7 @@ public class NewProject {
   private final Map<String, Object> params;
 
   private NewProject() {
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
   }
 
   public static NewProject create() {
index ca9e6237e06fbc13e28beb158f617fb69c52e9ea..3e51fa241797bdc55ac991976eea3be3a2a9b54d 100644 (file)
@@ -36,7 +36,7 @@ public class DefaultQProfileResult implements QProfileResult {
 
   @Override
   public List<String> infos() {
-    List<String> infos = new ArrayList<String>();
+    List<String> infos = new ArrayList<>();
     List<String> jsonInfos = (List<String>) json.get("infos");
     if (jsonInfos != null) {
       for (String info : jsonInfos) {
@@ -48,7 +48,7 @@ public class DefaultQProfileResult implements QProfileResult {
 
   @Override
   public List<String> warnings() {
-    List<String> warnings = new ArrayList<String>();
+    List<String> warnings = new ArrayList<>();
     List<String> jsonWarnings = (List<String>) json.get("warnings");
     if (jsonWarnings != null) {
       for (String warning : jsonWarnings) {
index 64f8ff9d7a6b605a578f4220a4751d2763cbab24..da8b9b82b54e7f747fc950de350bac9596addf28 100644 (file)
@@ -32,7 +32,7 @@ public class NewCondition {
   private final Map<String, Object> params;
 
   private NewCondition() {
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
   }
 
   public static NewCondition create(long qGateId) {
index 70fb4c6d5b5bd724a1dc3353a681f943acbaed11..e5fb7fc33b66a3108a6fbf4f037ecabbf14927c8 100644 (file)
@@ -32,7 +32,7 @@ public class UpdateCondition {
   private final Map<String, Object> params;
 
   private UpdateCondition() {
-    params = new HashMap<String, Object>();
+    params = new HashMap<>();
   }
 
   public static UpdateCondition create(long id) {
index b9497d652e225dcd76292c509fc25070bdfb5eee..a9909d265babd6939b4ca6d2baa35cc03949f1ea 100644 (file)
@@ -61,7 +61,7 @@ public class DefaultQualityGateClient implements QualityGateClient {
 
   @Override
   public QualityGate rename(long qGateId, String qGateName) {
-    Map<String, Object> params = new HashMap<String, Object>();
+    Map<String, Object> params = new HashMap<>();
     params.put("id", qGateId);
     params.put("name", qGateName);
     String json = requestFactory.post(RENAME_URL, params);
@@ -123,7 +123,7 @@ public class DefaultQualityGateClient implements QualityGateClient {
   }
 
   private Map<String, Object> selectionParams(long qGateId, long projectId) {
-    Map<String, Object> params = new HashMap<String, Object>();
+    Map<String, Object> params = new HashMap<>();
     params.put("gateId", Long.toString(qGateId));
     params.put("projectId", Long.toString(projectId));
     return params;
@@ -152,7 +152,7 @@ public class DefaultQualityGateClient implements QualityGateClient {
   private Collection<QualityGateCondition> jsonToConditions(String json) {
     Map jsonRoot = (Map) JSONValue.parse(json);
     Collection<Map> conditionArray = (Collection<Map>) jsonRoot.get("conditions");
-    Collection<QualityGateCondition> conditions = new ArrayList<QualityGateCondition>();
+    Collection<QualityGateCondition> conditions = new ArrayList<>();
     if (conditionArray != null) {
       for (Map conditionJson: conditionArray) {
         conditions.add(new DefaultQualityGateCondition(conditionJson));
index e29c5123a3758c4fb7efbdb86e0a660e1f8d1cd0..6367069401f854f00a00103a5b6fbed37e9cd1f7 100644 (file)
@@ -38,7 +38,7 @@ public class DefaultQualityGates implements QualityGates {
 
   @SuppressWarnings("unchecked")
   public DefaultQualityGates(Map<String, Object> json) {
-    qualityGates = new LinkedHashMap<Long, QualityGate>();
+    qualityGates = new LinkedHashMap<>();
     JSONArray gatesJson = JsonUtils.getArray(json, "qualitygates");
     if (gatesJson != null) {
       for (Object entry: gatesJson) {
index 434e5676cbb574b3334ca16a6192efda2de714a8..6192dc1b84fa8aa584b29de270552df9960e98ba 100644 (file)
@@ -147,7 +147,7 @@ public class Measure extends Model {
     if (data == null) {
       return null;
     }
-    Map<String, String> map = new LinkedHashMap<String, String>();
+    Map<String, String> map = new LinkedHashMap<>();
     String[] parts = data.split(separator);
     for (String part : parts) {
       String[] kv = part.split("=");
index 22077d37721d8be0678c50055e63975984c103b0..cc0437161a0d45a30b4cb51394183d6be8324a75 100644 (file)
@@ -34,7 +34,7 @@ public class Profile extends Model {
   private String name;
   private boolean defaultProfile;
   private String parentName;
-  private List<Rule> rules = new ArrayList<Rule>();
+  private List<Rule> rules = new ArrayList<>();
 
   @CheckForNull
   public String getLanguage() {
@@ -153,7 +153,7 @@ public class Profile extends Model {
 
     public Rule addParameter(@Nullable String key, @Nullable String value) {
       if (parameters==null) {
-        parameters = new HashMap<String,String>();
+        parameters = new HashMap<>();
       }
       parameters.put(key, value);
       return this;
index a8393c5dbbc13463a74181d5d8baa3d646798c72..e27a6870fc8729209c245ea8c3938ba3fd4c06d2 100644 (file)
@@ -28,7 +28,7 @@ import java.util.TreeMap;
 
 public class Source extends Model {
 
-  private SortedMap<Integer, String> lines = new TreeMap<Integer, String>();
+  private SortedMap<Integer, String> lines = new TreeMap<>();
 
   public Collection<String> getLines() {
     return lines.values();
index db0918e41468a6b310211c007e56f87cb8430954..fc3254e7b7236f84d1d2aa6537819411dfb17190 100644 (file)
@@ -49,7 +49,7 @@ public abstract class AbstractUnmarshaller<M extends Model> implements Unmarshal
   @Override
   public final List<M> toModels(String json) {
     WSUtils utils = WSUtils.getINSTANCE();
-    List<M> result = new ArrayList<M>();
+    List<M> result = new ArrayList<>();
     Object array = utils.parse(json);
     for (int i = 0; i < utils.getArraySize(array); i++) {
       Object elt = utils.getArrayElement(array, i);
index 5fa580560b81d3412bcde531380fd75bee2ec275..b907a174356978af2cf8f6c469f49b44cf318919 100644 (file)
@@ -40,7 +40,7 @@ public class ResourceSearchUnmarshaller extends AbstractUnmarshaller<ResourceSea
     result.setPageSize(utils.getInteger(json, "page_size"));
     result.setTotal(utils.getInteger(json, "total"));
 
-    List<ResourceSearchResult.Resource> resources = new ArrayList<ResourceSearchResult.Resource>();
+    List<ResourceSearchResult.Resource> resources = new ArrayList<>();
     JSONArray dataJson = JsonUtils.getArray((JSONObject) json, "data");
     if (dataJson != null) {
       for (Object jsonResource : dataJson) {
index c4cbdb64d29f7fb977a841f7c41090348bbf6db6..836d0f83d0da71a12ec3f443eacb4dc12281686c 100644 (file)
@@ -77,7 +77,7 @@ public class ResourceUnmarshaller extends AbstractUnmarshaller<Resource> {
 
   private List<Measure> parseMeasures(Object measuresJson) {
     WSUtils utils = WSUtils.getINSTANCE();
-    List<Measure> projectMeasures = new ArrayList<Measure>();
+    List<Measure> projectMeasures = new ArrayList<>();
     int len = utils.getArraySize(measuresJson);
     for (int i = 0; i < len; i++) {
       Object measureJson = utils.getArrayElement(measuresJson, i);
index 50a2411532ad336a30a3daca6e21b47627493efe..025cea9a2c685c994d16dccc290f9b8a4e08d98e 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Map;
 
 public class UserParameters {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private UserParameters() {
   }
index a77bd2f19430a443fb5162e22878f31ee450b111..2550ef713d6a10f3ed6db96d6724551a8b1ee0ff 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map;
  */
 public class UserQuery {
 
-  private final Map<String, Object> params = new HashMap<String, Object>();
+  private final Map<String, Object> params = new HashMap<>();
 
   private UserQuery() {
   }
index 2a73cd871ffdcafd7ec4063b4ef4255191931e8f..7b1af27b70bcf916c0b01f58e17bbb644537af56 100644 (file)
@@ -54,7 +54,7 @@ public class DefaultUserClient implements UserClient {
   @Override
   public List<User> find(UserQuery query) {
     String json = requestFactory.get(SEARCH_URL, query.urlParams());
-    List<User> result = new ArrayList<User>();
+    List<User> result = new ArrayList<>();
     Map jsonRoot = (Map) JSONValue.parse(json);
     List<Map> jsonUsers = (List<Map>) jsonRoot.get("users");
     if (jsonUsers != null) {
@@ -83,7 +83,7 @@ public class DefaultUserClient implements UserClient {
 
   @Override
   public void deactivate(String login) {
-    Map<String, Object> params = new HashMap<String, Object>();
+    Map<String, Object> params = new HashMap<>();
     params.put("login", login);
     requestFactory.post(DEACTIVATE_URL, params);
   }
index d9f35910a2c92f1909c88e45878ca957b57a640c..d85612b74faf6d2a88d5e78eea049231dcf09fe3 100644 (file)
@@ -59,7 +59,7 @@ public class JdbcSettings {
     if (!dir.exists()) {
       throw new MessageException("Directory does not exist: " + dirPath);
     }
-    List<File> files = new ArrayList<File>(FileUtils.listFiles(dir, new String[] {"jar"}, false));
+    List<File> files = new ArrayList<>(FileUtils.listFiles(dir, new String[] {"jar"}, false));
     if (files.isEmpty()) {
       throw new MessageException("Directory does not contain JDBC driver: " + dirPath);
     }
index 981a887712585dfc9f38f92aaefc8bcd1628c18f..b3ea11f54a4ae2e648477bb0ff9f728940c9b825 100644 (file)
@@ -2847,7 +2847,7 @@ public final class BatchReport {
             }
             case 56: {
               if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-                childRef_ = new java.util.ArrayList<java.lang.Integer>();
+                childRef_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000040;
               }
               childRef_.add(input.readInt32());
@@ -2857,7 +2857,7 @@ public final class BatchReport {
               int length = input.readRawVarint32();
               int limit = input.pushLimit(length);
               if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) {
-                childRef_ = new java.util.ArrayList<java.lang.Integer>();
+                childRef_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000040;
               }
               while (input.getBytesUntilLimit() > 0) {
@@ -2879,7 +2879,7 @@ public final class BatchReport {
             }
             case 82: {
               if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
-                link_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.ComponentLink>();
+                link_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000080;
               }
               link_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.ComponentLink.PARSER, extensionRegistry));
@@ -2887,7 +2887,7 @@ public final class BatchReport {
             }
             case 90: {
               if (!((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
-                event_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Event>();
+                event_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00004000;
               }
               event_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Event.PARSER, extensionRegistry));
@@ -4336,7 +4336,7 @@ public final class BatchReport {
       private java.util.List<java.lang.Integer> childRef_ = java.util.Collections.emptyList();
       private void ensureChildRefIsMutable() {
         if (!((bitField0_ & 0x00000040) == 0x00000040)) {
-          childRef_ = new java.util.ArrayList<java.lang.Integer>(childRef_);
+          childRef_ = new java.util.ArrayList<>(childRef_);
           bitField0_ |= 0x00000040;
          }
       }
@@ -4403,7 +4403,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureLinkIsMutable() {
         if (!((bitField0_ & 0x00000080) == 0x00000080)) {
-          link_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.ComponentLink>(link_);
+          link_ = new java.util.ArrayList<>(link_);
           bitField0_ |= 0x00000080;
          }
       }
@@ -4628,8 +4628,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.ComponentLink, org.sonar.batch.protocol.output.BatchReport.ComponentLink.Builder, org.sonar.batch.protocol.output.BatchReport.ComponentLinkOrBuilder> 
           getLinkFieldBuilder() {
         if (linkBuilder_ == null) {
-          linkBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.ComponentLink, org.sonar.batch.protocol.output.BatchReport.ComponentLink.Builder, org.sonar.batch.protocol.output.BatchReport.ComponentLinkOrBuilder>(
+          linkBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   link_,
                   ((bitField0_ & 0x00000080) == 0x00000080),
                   getParentForChildren(),
@@ -5047,7 +5046,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureEventIsMutable() {
         if (!((bitField0_ & 0x00004000) == 0x00004000)) {
-          event_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Event>(event_);
+          event_ = new java.util.ArrayList<>(event_);
           bitField0_ |= 0x00004000;
          }
       }
@@ -5272,8 +5271,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Event, org.sonar.batch.protocol.output.BatchReport.Event.Builder, org.sonar.batch.protocol.output.BatchReport.EventOrBuilder> 
           getEventFieldBuilder() {
         if (eventBuilder_ == null) {
-          eventBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Event, org.sonar.batch.protocol.output.BatchReport.Event.Builder, org.sonar.batch.protocol.output.BatchReport.EventOrBuilder>(
+          eventBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   event_,
                   ((bitField0_ & 0x00004000) == 0x00004000),
                   getParentForChildren(),
@@ -7763,7 +7761,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                measure_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Measure>();
+                measure_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               measure_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Measure.PARSER, extensionRegistry));
@@ -8177,7 +8175,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureMeasureIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          measure_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Measure>(measure_);
+          measure_ = new java.util.ArrayList<>(measure_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -8402,8 +8400,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Measure, org.sonar.batch.protocol.output.BatchReport.Measure.Builder, org.sonar.batch.protocol.output.BatchReport.MeasureOrBuilder> 
           getMeasureFieldBuilder() {
         if (measureBuilder_ == null) {
-          measureBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Measure, org.sonar.batch.protocol.output.BatchReport.Measure.Builder, org.sonar.batch.protocol.output.BatchReport.MeasureOrBuilder>(
+          measureBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   measure_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -12066,7 +12063,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                issue_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Issue>();
+                issue_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               issue_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Issue.PARSER, extensionRegistry));
@@ -12559,7 +12556,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureIssueIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          issue_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Issue>(issue_);
+          issue_ = new java.util.ArrayList<>(issue_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -12784,8 +12781,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Issue, org.sonar.batch.protocol.output.BatchReport.Issue.Builder, org.sonar.batch.protocol.output.BatchReport.IssueOrBuilder> 
           getIssueFieldBuilder() {
         if (issueBuilder_ == null) {
-          issueBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Issue, org.sonar.batch.protocol.output.BatchReport.Issue.Builder, org.sonar.batch.protocol.output.BatchReport.IssueOrBuilder>(
+          issueBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   issue_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -13027,7 +13023,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                changeset_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset>();
+                changeset_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               changeset_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.PARSER, extensionRegistry));
@@ -13035,7 +13031,7 @@ public final class BatchReport {
             }
             case 24: {
               if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
-                changesetIndexByLine_ = new java.util.ArrayList<java.lang.Integer>();
+                changesetIndexByLine_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000004;
               }
               changesetIndexByLine_.add(input.readInt32());
@@ -13045,7 +13041,7 @@ public final class BatchReport {
               int length = input.readRawVarint32();
               int limit = input.pushLimit(length);
               if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
-                changesetIndexByLine_ = new java.util.ArrayList<java.lang.Integer>();
+                changesetIndexByLine_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000004;
               }
               while (input.getBytesUntilLimit() > 0) {
@@ -14250,7 +14246,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureChangesetIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          changeset_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset>(changeset_);
+          changeset_ = new java.util.ArrayList<>(changeset_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -14475,8 +14471,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder> 
           getChangesetFieldBuilder() {
         if (changesetBuilder_ == null) {
-          changesetBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder>(
+          changesetBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   changeset_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -14489,7 +14484,7 @@ public final class BatchReport {
       private java.util.List<java.lang.Integer> changesetIndexByLine_ = java.util.Collections.emptyList();
       private void ensureChangesetIndexByLineIsMutable() {
         if (!((bitField0_ & 0x00000004) == 0x00000004)) {
-          changesetIndexByLine_ = new java.util.ArrayList<java.lang.Integer>(changesetIndexByLine_);
+          changesetIndexByLine_ = new java.util.ArrayList<>(changesetIndexByLine_);
           bitField0_ |= 0x00000004;
          }
       }
@@ -15293,8 +15288,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder> 
           getRangeFieldBuilder() {
         if (rangeBuilder_ == null) {
-          rangeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder>(
+          rangeBuilder_ = new com.google.protobuf.SingleFieldBuilder<>(
                   getRange(),
                   getParentForChildren(),
                   isClean());
@@ -15534,7 +15528,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                duplicate_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Duplicate>();
+                duplicate_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               duplicate_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Duplicate.PARSER, extensionRegistry));
@@ -16081,8 +16075,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder> 
           getOriginPositionFieldBuilder() {
         if (originPositionBuilder_ == null) {
-          originPositionBuilder_ = new com.google.protobuf.SingleFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder>(
+          originPositionBuilder_ = new com.google.protobuf.SingleFieldBuilder<>(
                   getOriginPosition(),
                   getParentForChildren(),
                   isClean());
@@ -16095,7 +16088,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureDuplicateIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          duplicate_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Duplicate>(duplicate_);
+          duplicate_ = new java.util.ArrayList<>(duplicate_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -16320,8 +16313,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Duplicate, org.sonar.batch.protocol.output.BatchReport.Duplicate.Builder, org.sonar.batch.protocol.output.BatchReport.DuplicateOrBuilder> 
           getDuplicateFieldBuilder() {
         if (duplicateBuilder_ == null) {
-          duplicateBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Duplicate, org.sonar.batch.protocol.output.BatchReport.Duplicate.Builder, org.sonar.batch.protocol.output.BatchReport.DuplicateOrBuilder>(
+          duplicateBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   duplicate_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -16438,7 +16430,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                duplication_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Duplication>();
+                duplication_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               duplication_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Duplication.PARSER, extensionRegistry));
@@ -16852,7 +16844,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureDuplicationIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          duplication_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Duplication>(duplication_);
+          duplication_ = new java.util.ArrayList<>(duplication_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -17077,8 +17069,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Duplication, org.sonar.batch.protocol.output.BatchReport.Duplication.Builder, org.sonar.batch.protocol.output.BatchReport.DuplicationOrBuilder> 
           getDuplicationFieldBuilder() {
         if (duplicationBuilder_ == null) {
-          duplicationBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Duplication, org.sonar.batch.protocol.output.BatchReport.Duplication.Builder, org.sonar.batch.protocol.output.BatchReport.DuplicationOrBuilder>(
+          duplicationBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   duplication_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -17962,7 +17953,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                symbol_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol>();
+                symbol_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               symbol_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol.PARSER, extensionRegistry));
@@ -18118,7 +18109,7 @@ public final class BatchReport {
               }
               case 18: {
                 if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                  reference_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Range>();
+                  reference_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000002;
                 }
                 reference_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Range.PARSER, extensionRegistry));
@@ -18617,8 +18608,7 @@ public final class BatchReport {
             org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder> 
             getDeclarationFieldBuilder() {
           if (declarationBuilder_ == null) {
-            declarationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
-                org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder>(
+            declarationBuilder_ = new com.google.protobuf.SingleFieldBuilder<>(
                     getDeclaration(),
                     getParentForChildren(),
                     isClean());
@@ -18631,7 +18621,7 @@ public final class BatchReport {
           java.util.Collections.emptyList();
         private void ensureReferenceIsMutable() {
           if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-            reference_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Range>(reference_);
+            reference_ = new java.util.ArrayList<>(reference_);
             bitField0_ |= 0x00000002;
            }
         }
@@ -18856,8 +18846,7 @@ public final class BatchReport {
             org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder> 
             getReferenceFieldBuilder() {
           if (referenceBuilder_ == null) {
-            referenceBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-                org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder>(
+            referenceBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                     reference_,
                     ((bitField0_ & 0x00000002) == 0x00000002),
                     getParentForChildren(),
@@ -19244,7 +19233,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureSymbolIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          symbol_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol>(symbol_);
+          symbol_ = new java.util.ArrayList<>(symbol_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -19469,8 +19458,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol, org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol.Builder, org.sonar.batch.protocol.output.BatchReport.Symbols.SymbolOrBuilder> 
           getSymbolFieldBuilder() {
         if (symbolBuilder_ == null) {
-          symbolBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol, org.sonar.batch.protocol.output.BatchReport.Symbols.Symbol.Builder, org.sonar.batch.protocol.output.BatchReport.Symbols.SymbolOrBuilder>(
+          symbolBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   symbol_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -21107,8 +21095,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder> 
           getRangeFieldBuilder() {
         if (rangeBuilder_ == null) {
-          rangeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.Range, org.sonar.batch.protocol.output.BatchReport.Range.Builder, org.sonar.batch.protocol.output.BatchReport.RangeOrBuilder>(
+          rangeBuilder_ = new com.google.protobuf.SingleFieldBuilder<>(
                   getRange(),
                   getParentForChildren(),
                   isClean());
@@ -22220,7 +22207,7 @@ public final class BatchReport {
             }
             case 18: {
               if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                coveredFile_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile>();
+                coveredFile_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000002;
               }
               coveredFile_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.PARSER, extensionRegistry));
@@ -22353,7 +22340,7 @@ public final class BatchReport {
               }
               case 16: {
                 if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                  coveredLine_ = new java.util.ArrayList<java.lang.Integer>();
+                  coveredLine_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000002;
                 }
                 coveredLine_.add(input.readInt32());
@@ -22363,7 +22350,7 @@ public final class BatchReport {
                 int length = input.readRawVarint32();
                 int limit = input.pushLimit(length);
                 if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                  coveredLine_ = new java.util.ArrayList<java.lang.Integer>();
+                  coveredLine_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000002;
                 }
                 while (input.getBytesUntilLimit() > 0) {
@@ -22756,7 +22743,7 @@ public final class BatchReport {
         private java.util.List<java.lang.Integer> coveredLine_ = java.util.Collections.emptyList();
         private void ensureCoveredLineIsMutable() {
           if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-            coveredLine_ = new java.util.ArrayList<java.lang.Integer>(coveredLine_);
+            coveredLine_ = new java.util.ArrayList<>(coveredLine_);
             bitField0_ |= 0x00000002;
            }
         }
@@ -23269,7 +23256,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureCoveredFileIsMutable() {
         if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-          coveredFile_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile>(coveredFile_);
+          coveredFile_ = new java.util.ArrayList<>(coveredFile_);
           bitField0_ |= 0x00000002;
          }
       }
@@ -23494,8 +23481,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder> 
           getCoveredFileFieldBuilder() {
         if (coveredFileBuilder_ == null) {
-          coveredFileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFile.Builder, org.sonar.batch.protocol.output.BatchReport.CoverageDetail.CoveredFileOrBuilder>(
+          coveredFileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   coveredFile_,
                   ((bitField0_ & 0x00000002) == 0x00000002),
                   getParentForChildren(),
@@ -24073,7 +24059,7 @@ public final class BatchReport {
             }
             case 10: {
               if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                dep_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency>();
+                dep_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000001;
               }
               dep_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency.PARSER, extensionRegistry));
@@ -24263,7 +24249,7 @@ public final class BatchReport {
               }
               case 34: {
                 if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                  child_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency>();
+                  child_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000008;
                 }
                 child_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency.PARSER, extensionRegistry));
@@ -25024,7 +25010,7 @@ public final class BatchReport {
           java.util.Collections.emptyList();
         private void ensureChildIsMutable() {
           if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-            child_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency>(child_);
+            child_ = new java.util.ArrayList<>(child_);
             bitField0_ |= 0x00000008;
            }
         }
@@ -25249,8 +25235,7 @@ public final class BatchReport {
             org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency.Builder, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependencyOrBuilder> 
             getChildFieldBuilder() {
           if (childBuilder_ == null) {
-            childBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-                org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency.Builder, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependencyOrBuilder>(
+            childBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                     child_,
                     ((bitField0_ & 0x00000008) == 0x00000008),
                     getParentForChildren(),
@@ -25570,7 +25555,7 @@ public final class BatchReport {
         java.util.Collections.emptyList();
       private void ensureDepIsMutable() {
         if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          dep_ = new java.util.ArrayList<org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency>(dep_);
+          dep_ = new java.util.ArrayList<>(dep_);
           bitField0_ |= 0x00000001;
          }
       }
@@ -25795,8 +25780,7 @@ public final class BatchReport {
           org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency.Builder, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependencyOrBuilder> 
           getDepFieldBuilder() {
         if (depBuilder_ == null) {
-          depBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependency.Builder, org.sonar.batch.protocol.output.BatchReport.ModuleDependencies.ModuleDependencyOrBuilder>(
+          depBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   dep_,
                   ((bitField0_ & 0x00000001) == 0x00000001),
                   getParentForChildren(),
index afc771a998ff6ee708888f89a6ab2fa62761dc1a..5b776ce0b826d866352a7094c1bd6342cbf459b8 100644 (file)
@@ -369,7 +369,7 @@ public final class FileSourceDb {
             }
             case 136: {
               if (!((mutable_bitField0_ & 0x00010000) == 0x00010000)) {
-                duplication_ = new java.util.ArrayList<java.lang.Integer>();
+                duplication_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00010000;
               }
               duplication_.add(input.readInt32());
@@ -379,7 +379,7 @@ public final class FileSourceDb {
               int length = input.readRawVarint32();
               int limit = input.pushLimit(length);
               if (!((mutable_bitField0_ & 0x00010000) == 0x00010000) && input.getBytesUntilLimit() > 0) {
-                duplication_ = new java.util.ArrayList<java.lang.Integer>();
+                duplication_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00010000;
               }
               while (input.getBytesUntilLimit() > 0) {
@@ -2205,7 +2205,7 @@ public final class FileSourceDb {
       private java.util.List<java.lang.Integer> duplication_ = java.util.Collections.emptyList();
       private void ensureDuplicationIsMutable() {
         if (!((bitField0_ & 0x00010000) == 0x00010000)) {
-          duplication_ = new java.util.ArrayList<java.lang.Integer>(duplication_);
+          duplication_ = new java.util.ArrayList<>(duplication_);
           bitField0_ |= 0x00010000;
          }
       }
@@ -2361,7 +2361,7 @@ public final class FileSourceDb {
             }
             case 10: {
               if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                lines_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceDb.Line>();
+                lines_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000001;
               }
               lines_.add(input.readMessage(org.sonar.server.source.db.FileSourceDb.Line.PARSER, extensionRegistry));
@@ -2708,7 +2708,7 @@ public final class FileSourceDb {
         java.util.Collections.emptyList();
       private void ensureLinesIsMutable() {
         if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          lines_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceDb.Line>(lines_);
+          lines_ = new java.util.ArrayList<>(lines_);
           bitField0_ |= 0x00000001;
          }
       }
@@ -2933,8 +2933,7 @@ public final class FileSourceDb {
           org.sonar.server.source.db.FileSourceDb.Line, org.sonar.server.source.db.FileSourceDb.Line.Builder, org.sonar.server.source.db.FileSourceDb.LineOrBuilder> 
           getLinesFieldBuilder() {
         if (linesBuilder_ == null) {
-          linesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.server.source.db.FileSourceDb.Line, org.sonar.server.source.db.FileSourceDb.Line.Builder, org.sonar.server.source.db.FileSourceDb.LineOrBuilder>(
+          linesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   lines_,
                   ((bitField0_ & 0x00000001) == 0x00000001),
                   getParentForChildren(),
@@ -3151,7 +3150,7 @@ public final class FileSourceDb {
             }
             case 58: {
               if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-                coveredFile_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceDb.Test.CoveredFile>();
+                coveredFile_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000040;
               }
               coveredFile_.add(input.readMessage(org.sonar.server.source.db.FileSourceDb.Test.CoveredFile.PARSER, extensionRegistry));
@@ -3390,7 +3389,7 @@ public final class FileSourceDb {
               }
               case 16: {
                 if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
-                  coveredLine_ = new java.util.ArrayList<java.lang.Integer>();
+                  coveredLine_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000002;
                 }
                 coveredLine_.add(input.readInt32());
@@ -3400,7 +3399,7 @@ public final class FileSourceDb {
                 int length = input.readRawVarint32();
                 int limit = input.pushLimit(length);
                 if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
-                  coveredLine_ = new java.util.ArrayList<java.lang.Integer>();
+                  coveredLine_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000002;
                 }
                 while (input.getBytesUntilLimit() > 0) {
@@ -3866,7 +3865,7 @@ public final class FileSourceDb {
         private java.util.List<java.lang.Integer> coveredLine_ = java.util.Collections.emptyList();
         private void ensureCoveredLineIsMutable() {
           if (!((bitField0_ & 0x00000002) == 0x00000002)) {
-            coveredLine_ = new java.util.ArrayList<java.lang.Integer>(coveredLine_);
+            coveredLine_ = new java.util.ArrayList<>(coveredLine_);
             bitField0_ |= 0x00000002;
            }
         }
@@ -4921,7 +4920,7 @@ public final class FileSourceDb {
         java.util.Collections.emptyList();
       private void ensureCoveredFileIsMutable() {
         if (!((bitField0_ & 0x00000040) == 0x00000040)) {
-          coveredFile_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceDb.Test.CoveredFile>(coveredFile_);
+          coveredFile_ = new java.util.ArrayList<>(coveredFile_);
           bitField0_ |= 0x00000040;
          }
       }
@@ -5146,8 +5145,7 @@ public final class FileSourceDb {
           org.sonar.server.source.db.FileSourceDb.Test.CoveredFile, org.sonar.server.source.db.FileSourceDb.Test.CoveredFile.Builder, org.sonar.server.source.db.FileSourceDb.Test.CoveredFileOrBuilder> 
           getCoveredFileFieldBuilder() {
         if (coveredFileBuilder_ == null) {
-          coveredFileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.server.source.db.FileSourceDb.Test.CoveredFile, org.sonar.server.source.db.FileSourceDb.Test.CoveredFile.Builder, org.sonar.server.source.db.FileSourceDb.Test.CoveredFileOrBuilder>(
+          coveredFileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   coveredFile_,
                   ((bitField0_ & 0x00000040) == 0x00000040),
                   getParentForChildren(),
index e03062ece8079ab9f22b6cfac1f75b0cd2c792de..3fbf75e74c1d67fb4427e2ebd59324f32fdfd3ab 100644 (file)
@@ -209,7 +209,7 @@ public final class FileSourceTestDb {
             }
             case 58: {
               if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
-                coverageBlock_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock>();
+                coverageBlock_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000040;
               }
               coverageBlock_.add(input.readMessage(org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.PARSER, extensionRegistry));
@@ -409,7 +409,7 @@ public final class FileSourceTestDb {
               }
               case 32: {
                 if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                  lines_ = new java.util.ArrayList<java.lang.Integer>();
+                  lines_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000008;
                 }
                 lines_.add(input.readInt32());
@@ -419,7 +419,7 @@ public final class FileSourceTestDb {
                 int length = input.readRawVarint32();
                 int limit = input.pushLimit(length);
                 if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
-                  lines_ = new java.util.ArrayList<java.lang.Integer>();
+                  lines_ = new java.util.ArrayList<>();
                   mutable_bitField0_ |= 0x00000008;
                 }
                 while (input.getBytesUntilLimit() > 0) {
@@ -1220,7 +1220,7 @@ public final class FileSourceTestDb {
         private java.util.List<java.lang.Integer> lines_ = java.util.Collections.emptyList();
         private void ensureLinesIsMutable() {
           if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-            lines_ = new java.util.ArrayList<java.lang.Integer>(lines_);
+            lines_ = new java.util.ArrayList<>(lines_);
             bitField0_ |= 0x00000008;
            }
         }
@@ -2444,7 +2444,7 @@ public final class FileSourceTestDb {
         java.util.Collections.emptyList();
       private void ensureCoverageBlockIsMutable() {
         if (!((bitField0_ & 0x00000040) == 0x00000040)) {
-          coverageBlock_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock>(coverageBlock_);
+          coverageBlock_ = new java.util.ArrayList<>(coverageBlock_);
           bitField0_ |= 0x00000040;
          }
       }
@@ -2668,8 +2668,7 @@ public final class FileSourceTestDb {
           org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder> 
           getCoverageBlockFieldBuilder() {
         if (coverageBlockBuilder_ == null) {
-          coverageBlockBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlock.Builder, org.sonar.server.source.db.FileSourceTestDb.Test.CoverageBlockOrBuilder>(
+          coverageBlockBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   coverageBlock_,
                   ((bitField0_ & 0x00000040) == 0x00000040),
                   getParentForChildren(),
@@ -2771,7 +2770,7 @@ public final class FileSourceTestDb {
             }
             case 10: {
               if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
-                test_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test>();
+                test_ = new java.util.ArrayList<>();
                 mutable_bitField0_ |= 0x00000001;
               }
               test_.add(input.readMessage(org.sonar.server.source.db.FileSourceTestDb.Test.PARSER, extensionRegistry));
@@ -3118,7 +3117,7 @@ public final class FileSourceTestDb {
         java.util.Collections.emptyList();
       private void ensureTestIsMutable() {
         if (!((bitField0_ & 0x00000001) == 0x00000001)) {
-          test_ = new java.util.ArrayList<org.sonar.server.source.db.FileSourceTestDb.Test>(test_);
+          test_ = new java.util.ArrayList<>(test_);
           bitField0_ |= 0x00000001;
          }
       }
@@ -3342,8 +3341,7 @@ public final class FileSourceTestDb {
           org.sonar.server.source.db.FileSourceTestDb.Test, org.sonar.server.source.db.FileSourceTestDb.Test.Builder, org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder> 
           getTestFieldBuilder() {
         if (testBuilder_ == null) {
-          testBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.sonar.server.source.db.FileSourceTestDb.Test, org.sonar.server.source.db.FileSourceTestDb.Test.Builder, org.sonar.server.source.db.FileSourceTestDb.TestOrBuilder>(
+          testBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<>(
                   test_,
                   ((bitField0_ & 0x00000001) == 0x00000001),
                   getParentForChildren(),
index 219f8a536ea9960df03934432c742210dd807b27..1571119eb992b32f9d42592238150bd623c457cb 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Map;
 public class ActiveRule {
   private final String repositoryKey, ruleKey, templateRuleKey;
   private final String name, severity, internalKey, language;
-  private final Map<String, String> params = new HashMap<String, String>();
+  private final Map<String, String> params = new HashMap<>();
 
   public ActiveRule(String repositoryKey, String ruleKey, @Nullable String templateRuleKey, String name, @Nullable String severity,
                     @Nullable String internalKey, @Nullable String language) {
index 4dccd3a286fce1b1460234676ba4076c85ebd00d..a31828ccc9c416e212981dce69b73a42962de45d 100644 (file)
@@ -33,8 +33,8 @@ import java.util.Map;
 public class GlobalRepositories {
 
   private long timestamp;
-  private Collection<Metric> metrics = new ArrayList<Metric>();
-  private Map<String, String> globalSettings = new HashMap<String, String>();
+  private Collection<Metric> metrics = new ArrayList<>();
+  private Map<String, String> globalSettings = new HashMap<>();
 
   public Map<String, String> globalSettings() {
     return globalSettings;
index eb3200b6ac317d0327a373d7ec796a7781072893..803560c176a67378f4478c91d7c957928e27e1d4 100644 (file)
@@ -33,10 +33,10 @@ import java.util.*;
 public class ProjectRepositories {
 
   private long timestamp;
-  private Map<String, QProfile> qprofilesByLanguage = new HashMap<String, QProfile>();
-  private Collection<ActiveRule> activeRules = new ArrayList<ActiveRule>();
-  private Map<String, Map<String, String>> settingsByModule = new HashMap<String, Map<String, String>>();
-  private Map<String, Map<String, FileData>> fileDataByModuleAndPath = new HashMap<String, Map<String, FileData>>();
+  private Map<String, QProfile> qprofilesByLanguage = new HashMap<>();
+  private Collection<ActiveRule> activeRules = new ArrayList<>();
+  private Map<String, Map<String, String>> settingsByModule = new HashMap<>();
+  private Map<String, Map<String, FileData>> fileDataByModuleAndPath = new HashMap<>();
   private Date lastAnalysisDate;
 
   public Map<String, String> settings(String moduleKey) {
index 5a66504364ee3aee9314aa69b7dbf8cf59f6f234..dfd3a7c009ccdf2b52921be5484a5e23a4e97bcb 100644 (file)
@@ -160,7 +160,7 @@ public class BatchExtensionDictionnary {
    * Extension dependencies
    */
   private <T> List<Object> getDependencies(T extension) {
-    List<Object> result = new ArrayList<Object>();
+    List<Object> result = new ArrayList<>();
     result.addAll(evaluateAnnotatedClasses(extension, DependsUpon.class));
     return result;
   }
@@ -169,7 +169,7 @@ public class BatchExtensionDictionnary {
    * Objects that depend upon this extension.
    */
   public <T> List<Object> getDependents(T extension) {
-    List<Object> result = new ArrayList<Object>();
+    List<Object> result = new ArrayList<>();
     result.addAll(evaluateAnnotatedClasses(extension, DependedUpon.class));
     return result;
   }
index acf6658a16a2b4697341e61ff6cdc18b593889c7..c98fd8faf30b19128a5893ff121d9539ec4a8d75 100644 (file)
@@ -44,7 +44,7 @@ public class JdbcLeakPrevention {
   public List<String> unregisterDrivers() throws SQLException {
     Set<Driver> registeredDrivers = registeredDrivers();
 
-    List<String> unregisteredNames = new ArrayList<String>();
+    List<String> unregisteredNames = new ArrayList<>();
     Enumeration<Driver> drivers = DriverManager.getDrivers();
     while (drivers.hasMoreElements()) {
       Driver driver = drivers.nextElement();
@@ -60,7 +60,7 @@ public class JdbcLeakPrevention {
   }
 
   private Set<Driver> registeredDrivers() {
-    Set<Driver> registeredDrivers = new HashSet<Driver>();
+    Set<Driver> registeredDrivers = new HashSet<>();
     Enumeration<Driver> drivers = DriverManager.getDrivers();
     while (drivers.hasMoreElements()) {
       Driver driver = drivers.nextElement();
index 3af2092c66e05ee04be7ddd416b9383d9c45f1b6..1c4bf3e019ad6e7d73476d96a97b273ec52ae62b 100644 (file)
@@ -102,8 +102,8 @@ public final class DebtDecorator implements Decorator {
 
   private void saveMeasures(DecoratorContext context, List<Issue> issues) {
     Long total = 0L;
-    SumMap<RuleKey> ruleDebts = new SumMap<RuleKey>();
-    SumMap<Characteristic> characteristicDebts = new SumMap<Characteristic>();
+    SumMap<RuleKey> ruleDebts = new SumMap<>();
+    SumMap<Characteristic> characteristicDebts = new SumMap<>();
 
     // Aggregate rules debt from current issues (and populate current characteristic debt)
     for (Issue issue : issues) {
index c50574fb6371064477b9b55510589fe9bcf1d7be..a77a09cb844bf8663f73c35fa9a7e18a0d324f9f 100644 (file)
@@ -39,7 +39,7 @@ public final class DecoratorsSelector {
   }
 
   public Collection<Decorator> select(Project project) {
-    List<Decorator> decorators = new ArrayList<Decorator>(batchExtDictionnary.select(Decorator.class, project, false, null));
+    List<Decorator> decorators = new ArrayList<>(batchExtDictionnary.select(Decorator.class, project, false, null));
     SetMultimap<Metric, Decorator> decoratorsByGeneratedMetric = getDecoratorsByMetric(decorators);
     for (Metric metric : batchExtDictionnary.select(Metric.class, null, false, null)) {
       if (metric.getFormula() != null) {
index 95c3da4ae8c8ca842bd05c5a75f012099048a756..f0527ca66f630bc2b195c7ca33a308580240deb5 100644 (file)
@@ -42,7 +42,7 @@ public class DirectoryDsmDecorator extends DsmDecorator {
   @Override
   protected List<Resource> getChildren(Resource resource, DecoratorContext context) {
     List<DecoratorContext> fileContexts = context.getChildren();
-    List<Resource> files = new ArrayList<Resource>(fileContexts.size());
+    List<Resource> files = new ArrayList<>(fileContexts.size());
     for (DecoratorContext decoratorContext : fileContexts) {
       files.add(decoratorContext.getResource());
     }
@@ -51,7 +51,7 @@ public class DirectoryDsmDecorator extends DsmDecorator {
 
   @Override
   protected Set<Edge> doProcess(List<Resource> children, DecoratorContext context) {
-    IncrementalCyclesAndFESSolver<Resource> cycleDetector = new IncrementalCyclesAndFESSolver<Resource>(getIndex(), children);
+    IncrementalCyclesAndFESSolver<Resource> cycleDetector = new IncrementalCyclesAndFESSolver<>(getIndex(), children);
     Set<Cycle> cycles = cycleDetector.getCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycles);
index 8dafbe0cbd0bedefcf88e0d6325180e5aa4723ff..790debf713b2fca1dd1403bfee93a0738d2d36d3 100644 (file)
@@ -91,7 +91,7 @@ public abstract class DsmDecorator implements Decorator {
   }
 
   protected final Dsm<Resource> getDsm(Collection<Resource> children, Set<Edge> feedbackEdges) {
-    Dsm<Resource> dsm = new Dsm<Resource>(index, children, feedbackEdges);
+    Dsm<Resource> dsm = new Dsm<>(index, children, feedbackEdges);
     DsmTopologicalSorter.sort(dsm);
     return dsm;
   }
@@ -112,7 +112,7 @@ public abstract class DsmDecorator implements Decorator {
   }
 
   protected final List<Dependency> getEdges(Collection<Resource> vertices) {
-    List<Dependency> result = new ArrayList<Dependency>();
+    List<Dependency> result = new ArrayList<>();
     for (Resource vertice : vertices) {
       Collection<Dependency> outgoingEdges = index.getOutgoingEdges(vertice);
       if (outgoingEdges != null) {
index 4d04022e5095c0379eb2af7fa268cb7a3bf7a74d..6956cac89b74528d4d69a8cb639d1d5dc3bcffaa 100644 (file)
@@ -112,7 +112,7 @@ public class MavenDependenciesSensor implements Sensor {
 
     private String scope;
 
-    List<InputDependency> dependencies = new ArrayList<InputDependency>();
+    List<InputDependency> dependencies = new ArrayList<>();
 
     public InputDependency(String key, String version) {
       this.key = key;
index 66471955795a100601f3714c4e2ea279e2d18c96..620ceeabd3f1f71fdcb2d1f51e00502ef344bd77 100644 (file)
@@ -61,7 +61,7 @@ public class ProjectDsmDecorator extends DsmDecorator {
 
   @Override
   protected Set<Edge> doProcess(List<Resource> children, DecoratorContext context) {
-    CycleDetector<Resource> cycleDetector = new CycleDetector<Resource>(getIndex(), children);
+    CycleDetector<Resource> cycleDetector = new CycleDetector<>(getIndex(), children);
     Set<Cycle> cycles = cycleDetector.getCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycles);
index 9e03a13c7df6164aa1be0de076a61f41ebe9ac26..62aa622b11d7c73e234db9abf7d117162567eaba 100644 (file)
@@ -43,7 +43,7 @@ public class SubProjectDsmDecorator extends DsmDecorator {
   @Override
   protected List<Resource> getChildren(Resource resource, DecoratorContext context) {
     List<DecoratorContext> directoryContexts = context.getChildren();
-    List<Resource> directories = new ArrayList<Resource>(directoryContexts.size());
+    List<Resource> directories = new ArrayList<>(directoryContexts.size());
     for (DecoratorContext decoratorContext : directoryContexts) {
       directories.add(decoratorContext.getResource());
     }
@@ -52,7 +52,7 @@ public class SubProjectDsmDecorator extends DsmDecorator {
 
   @Override
   protected Set<Edge> doProcess(List<Resource> children, DecoratorContext context) {
-    IncrementalCyclesAndFESSolver<Resource> cycleDetector = new IncrementalCyclesAndFESSolver<Resource>(getIndex(), children);
+    IncrementalCyclesAndFESSolver<Resource> cycleDetector = new IncrementalCyclesAndFESSolver<>(getIndex(), children);
     Set<Cycle> cycles = cycleDetector.getCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycles);
index 5fe13a1c89a7649e4717e759c888474146ef3f5f..af4eedd4bd9421167129c6e6bbf26a8076b585da 100644 (file)
@@ -37,7 +37,7 @@ public class BatchResource {
   private final Resource r;
   private Snapshot s;
   private final BatchResource parent;
-  private final Collection<BatchResource> children = new ArrayList<BatchResource>();
+  private final Collection<BatchResource> children = new ArrayList<>();
   private InputPath inputPath;
 
   public BatchResource(int batchId, Resource r, @Nullable BatchResource parent) {
index fa98e02d0b87e525469aa19f56dd108483fb8c55..be01e354f7be8c5ae85101342202b6fce240b906 100644 (file)
@@ -300,29 +300,29 @@ public class Cache<V> {
    * Lazy-loading values for given keys
    */
   public Iterable<V> values(Object firstKey, Object secondKey) {
-    return new ValueIterable<V>(exchange, firstKey, secondKey);
+    return new ValueIterable<>(exchange, firstKey, secondKey);
   }
 
   /**
    * Lazy-loading values for a given key
    */
   public Iterable<V> values(Object firstKey) {
-    return new ValueIterable<V>(exchange, firstKey);
+    return new ValueIterable<>(exchange, firstKey);
   }
 
   /**
    * Lazy-loading values
    */
   public Iterable<V> values() {
-    return new ValueIterable<V>(exchange);
+    return new ValueIterable<>(exchange);
   }
 
   public Iterable<Entry<V>> entries() {
-    return new EntryIterable<V>(exchange);
+    return new EntryIterable<>(exchange);
   }
 
   public Iterable<Entry<V>> entries(Object firstKey) {
-    return new EntryIterable<V>(exchange, firstKey);
+    return new EntryIterable<>(exchange, firstKey);
   }
 
   private void resetKey(Object key) {
@@ -370,7 +370,7 @@ public class Cache<V> {
       }
       originExchange.append(Key.BEFORE);
       Exchange iteratorExchange = new Exchange(originExchange);
-      return new ValueIterator<T>(iteratorExchange, filter);
+      return new ValueIterator<>(iteratorExchange, filter);
     }
   }
 
@@ -431,7 +431,7 @@ public class Cache<V> {
       }
       originExchange.append(Key.BEFORE);
       Exchange iteratorExchange = new Exchange(originExchange);
-      return new EntryIterator<T>(iteratorExchange, filter);
+      return new EntryIterator<>(iteratorExchange, filter);
     }
   }
 
@@ -468,7 +468,7 @@ public class Cache<V> {
         for (int i = 0; i < key.getDepth(); i++) {
           array[i] = key.indexTo(i - key.getDepth()).decode();
         }
-        return new Entry<T>(array, value);
+        return new Entry<>(array, value);
       }
       throw new NoSuchElementException();
     }
index ac0f509ec9d27f91c0bc34f687d312c5801dc029..74c2d7f6ad92a00c953158038f028224ad021075 100644 (file)
@@ -91,7 +91,7 @@ public class Caches implements Startable {
     try {
       Exchange exchange = persistit.getExchange(volume, cacheName, true);
       exchange.setMaximumValueSize(Value.MAXIMUM_SIZE);
-      Cache<V> cache = new Cache<V>(cacheName, exchange);
+      Cache<V> cache = new Cache<>(cacheName, exchange);
       cacheNames.add(cacheName);
       return cache;
     } catch (Exception e) {
index 14803caa3b569d9ff17bca53bcd14bd184aaea00..a0436ba85fa290ff50324b5c4dabfbec5715cdc5 100644 (file)
@@ -223,7 +223,7 @@ public class DefaultIndex extends SonarIndex {
     } else {
       unfiltered = measureCache.byResource(indexedResource);
     }
-    Collection<Measure> all = new ArrayList<Measure>();
+    Collection<Measure> all = new ArrayList<>();
     if (unfiltered != null) {
       for (Measure measure : unfiltered) {
         all.add(measure);
@@ -300,7 +300,7 @@ public class DefaultIndex extends SonarIndex {
   private void registerOutgoingDependency(Dependency dependency) {
     Map<Resource, Dependency> outgoingDeps = outgoingDependenciesByResource.get(dependency.getFrom());
     if (outgoingDeps == null) {
-      outgoingDeps = new HashMap<Resource, Dependency>();
+      outgoingDeps = new HashMap<>();
       outgoingDependenciesByResource.put(dependency.getFrom(), outgoingDeps);
     }
     outgoingDeps.put(dependency.getTo(), dependency);
@@ -309,7 +309,7 @@ public class DefaultIndex extends SonarIndex {
   private void registerIncomingDependency(Dependency dependency) {
     Map<Resource, Dependency> incomingDeps = incomingDependenciesByResource.get(dependency.getTo());
     if (incomingDeps == null) {
-      incomingDeps = new HashMap<Resource, Dependency>();
+      incomingDeps = new HashMap<>();
       incomingDependenciesByResource.put(dependency.getTo(), incomingDeps);
     }
     incomingDeps.put(dependency.getFrom(), dependency);
index 33c2a98cc693f9843de0304a3e850a2877036f66..81891856cdf078b69e461c8482918b2b05aa77f3 100644 (file)
@@ -80,9 +80,9 @@ public class ResourceKeyMigration {
 
   void migrateIfNeeded(Project module, Iterable<InputFile> inputFiles, DefaultModuleFileSystem fs) {
     logger.info("Update component keys");
-    Map<String, InputFile> deprecatedFileKeyMapper = new HashMap<String, InputFile>();
-    Map<String, InputFile> deprecatedTestKeyMapper = new HashMap<String, InputFile>();
-    Map<String, String> deprecatedDirectoryKeyMapper = new HashMap<String, String>();
+    Map<String, InputFile> deprecatedFileKeyMapper = new HashMap<>();
+    Map<String, InputFile> deprecatedTestKeyMapper = new HashMap<>();
+    Map<String, String> deprecatedDirectoryKeyMapper = new HashMap<>();
     for (InputFile inputFile : inputFiles) {
       String deprecatedKey = computeDeprecatedKey(module.getKey(), (DeprecatedDefaultInputFile) inputFile, fs);
       if (deprecatedKey != null) {
@@ -225,7 +225,7 @@ public class ResourceKeyMigration {
       .setParameter("rootId", moduleId)
       .setParameter("enabled", false)
       .getResultList();
-    Map<String, ResourceModel> disabledResourceByKey = new HashMap<String, ResourceModel>();
+    Map<String, ResourceModel> disabledResourceByKey = new HashMap<>();
     for (ResourceModel disabledResourceModel : disabledResources) {
       disabledResourceByKey.put(disabledResourceModel.getKey(), disabledResourceModel);
     }
index 9f92432a026f6856f91200359d8876220ef721db..35765f96fb902935643e42e350985cf3fd3e62e5 100644 (file)
@@ -296,7 +296,7 @@ public class BatchMediumTester {
   }
 
   private static class FakeServerLineHashesLoader implements ServerLineHashesLoader {
-    private Map<String, String[]> byKey = new HashMap<String, String[]>();
+    private Map<String, String[]> byKey = new HashMap<>();
 
     @Override
     public String[] getLineHashes(String fileKey) {
index 8aa0a88a5748508deb970db32ca28eb7e07b4368..b352631edddbe37d93468508487c179df9e8b3b5 100644 (file)
@@ -193,7 +193,7 @@ public class TaskResult implements org.sonar.batch.mediumtest.ScanTaskObserver {
       return Collections.emptyList();
     }
     TextPointer pointer = file.newPointer(line, lineOffset);
-    List<TypeOfText> result = new ArrayList<TypeOfText>();
+    List<TypeOfText> result = new ArrayList<>();
     InputStream inputStream = null;
     try {
       inputStream = FileUtils.openInputStream(highlightingFile);
index 612e4d49d5adb5e55157ae283d590061b3cedf13..32c2538ab10b4ecaa45e54ba6c6f7572cff4593d 100644 (file)
@@ -81,7 +81,7 @@ public class PhasesTimeProfiler implements SensorExecutionHandler, DecoratorExec
 
   static class DecoratorsProfiler {
     List<Decorator> decorators = Lists.newArrayList();
-    Map<Decorator, Long> durations = new IdentityHashMap<Decorator, Long>();
+    Map<Decorator, Long> durations = new IdentityHashMap<>();
     long startTime;
     Decorator currentDecorator;
 
index d4bce006df4cb3b430a75df18e0142a00854424c..687adba5178b344efedbcaaeabba764bf47eae18 100644 (file)
@@ -76,7 +76,7 @@ public abstract class AbstractTimeProfiling {
         return Long.valueOf(o2.getValue().totalTime()).compareTo(o1.getValue().totalTime());
       }
     });
-    Map<Object, G> sortedMap = new LinkedHashMap<Object, G>();
+    Map<Object, G> sortedMap = new LinkedHashMap<>();
     for (Map.Entry<?, G> entry : entries) {
       sortedMap.put(entry.getKey(), entry.getValue());
     }
@@ -85,7 +85,7 @@ public abstract class AbstractTimeProfiling {
 
   static <G extends AbstractTimeProfiling> List<G> truncate(Collection<G> sortedList) {
     int maxSize = 10;
-    List<G> result = new ArrayList<G>(maxSize);
+    List<G> result = new ArrayList<>(maxSize);
     int i = 0;
     for (G item : sortedList) {
       if (i >= maxSize || item.totalTime() == 0) {
index c4a0fc191745b8728a878016e76b8097381c95a2..f4bae408420a537389193d3303ceed71eac731e3 100644 (file)
@@ -30,8 +30,8 @@ import java.util.Map.Entry;
 
 public class ModuleProfiling extends AbstractTimeProfiling {
 
-  private Map<Phase, PhaseProfiling> profilingPerPhase = new HashMap<Phase, PhaseProfiling>();
-  private Map<String, ItemProfiling> profilingPerBatchStep = new LinkedHashMap<String, ItemProfiling>();
+  private Map<Phase, PhaseProfiling> profilingPerPhase = new HashMap<>();
+  private Map<String, ItemProfiling> profilingPerBatchStep = new LinkedHashMap<>();
   private final Project module;
 
   public ModuleProfiling(@Nullable Project module, System2 system) {
index 2bb5599a0fe505d634552dab9fdfc5845dbf66d5..15b16d02b49f0f12a1102cfd53b9b20f1141a3d1 100644 (file)
@@ -30,7 +30,7 @@ public class PhaseProfiling extends AbstractTimeProfiling {
 
   private final Phase phase;
 
-  private Map<String, ItemProfiling> profilingPerItem = new HashMap<String, ItemProfiling>();
+  private Map<String, ItemProfiling> profilingPerItem = new HashMap<>();
 
   PhaseProfiling(System2 system, Phase phase) {
     super(system);
index b4357e407bd73e14f3827774b8903fcc37d7696c..c62c528c2fb390efbe1981b67f72949da1c0c00d 100644 (file)
@@ -59,7 +59,7 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
   @VisibleForTesting
   ModuleProfiling totalProfiling;
 
-  private Map<Project, ModuleProfiling> modulesProfilings = new HashMap<Project, ModuleProfiling>();
+  private Map<Project, ModuleProfiling> modulesProfilings = new HashMap<>();
   private DecoratorsProfiler decoratorsProfiler;
 
   private final System2 system;
@@ -258,7 +258,7 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
 
   class DecoratorsProfiler {
     private List<Decorator> decorators = Lists.newArrayList();
-    private Map<Decorator, Long> durations = new IdentityHashMap<Decorator, Long>();
+    private Map<Decorator, Long> durations = new IdentityHashMap<>();
     private long startTime;
     private Decorator currentDecorator;
 
index fe5f50ba9eac7de3f3daf755b8c9638101cd1f65..dd3b43b422fb613d36deeb2c3f7c72deb7bba704 100644 (file)
@@ -54,7 +54,7 @@ public class DefaultLanguagesRepository implements LanguagesRepository {
   @Override
   public Collection<Language> all() {
     org.sonar.api.resources.Language[] all = languages.all();
-    Collection<Language> result = new ArrayList<Language>(all.length);
+    Collection<Language> result = new ArrayList<>(all.length);
     for (org.sonar.api.resources.Language language : all) {
       result.add(new Language(language.getKey(), language.getName(), language.getFileSuffixes()));
     }
index 41914729afa4d0f322a190a809da445989217f5d..302f71e5db281342e1fdc0c9a51c28cb80e78c61 100644 (file)
@@ -85,7 +85,7 @@ public class RulesProfileWrapper extends RulesProfile {
 
   @Override
   public List<ActiveRule> getActiveRules() {
-    List<ActiveRule> activeRules = new ArrayList<ActiveRule>();
+    List<ActiveRule> activeRules = new ArrayList<>();
     for (RulesProfile profile : profiles) {
       activeRules.addAll(profile.getActiveRules());
     }
@@ -105,7 +105,7 @@ public class RulesProfileWrapper extends RulesProfile {
 
   @Override
   public List<ActiveRule> getActiveRulesByRepository(String repositoryKey) {
-    List<ActiveRule> activeRules = new ArrayList<ActiveRule>();
+    List<ActiveRule> activeRules = new ArrayList<>();
     for (RulesProfile profile : profiles) {
       activeRules.addAll(profile.getActiveRulesByRepository(repositoryKey));
     }
@@ -114,7 +114,7 @@ public class RulesProfileWrapper extends RulesProfile {
 
   @Override
   public List<ActiveRule> getActiveRules(boolean acceptDisabledRules) {
-    List<ActiveRule> activeRules = new ArrayList<ActiveRule>();
+    List<ActiveRule> activeRules = new ArrayList<>();
     for (RulesProfile profile : profiles) {
       activeRules.addAll(profile.getActiveRules(acceptDisabledRules));
     }
index ac923055950d54d9c8d993a0511531e61299c1e4..15a6d3cd3aee31d7a471cbcfc6c76559e103525f 100644 (file)
@@ -103,7 +103,7 @@ public class UsedQProfiles {
   }
 
   public Map<String, QProfile> profilesByKey() {
-    Map<String, QProfile> map = new HashMap<String, QProfile>();
+    Map<String, QProfile> map = new HashMap<>();
     for (QProfile profile : profiles) {
       map.put(profile.getKey(), profile);
     }
index 3c63472ede60c36d009f2db0319770ab2f6f38ab..861600fdba94d11d9a4b42943a13d8b917081bbd 100644 (file)
@@ -125,9 +125,9 @@ public class ProjectReactorBuilder {
   }
 
   private Map<String, Map<String, String>> extractPropertiesByModule(String currentModuleId, Map<String, String> parentProperties) {
-    Map<String, String> allProperties = new HashMap<String, String>();
+    Map<String, String> allProperties = new HashMap<>();
     allProperties.putAll(parentProperties);
-    Map<String, String> currentModuleProperties = new HashMap<String, String>();
+    Map<String, String> currentModuleProperties = new HashMap<>();
     String prefix = !currentModuleId.isEmpty() ? currentModuleId + "." : "";
     // By default all properties starting with module prefix belong to current module
     for (Map.Entry<String, String> entry : allProperties.entrySet()) {
@@ -138,11 +138,11 @@ public class ProjectReactorBuilder {
         parentProperties.remove(key);
       }
     }
-    List<String> moduleIds = new ArrayList<String>(Arrays.asList(getListFromProperty(currentModuleProperties, PROPERTY_MODULES)));
+    List<String> moduleIds = new ArrayList<>(Arrays.asList(getListFromProperty(currentModuleProperties, PROPERTY_MODULES)));
     // Sort module by reverse lexicographic order to avoid issue when one module id is a prefix of another one
     Collections.sort(moduleIds);
     Collections.reverse(moduleIds);
-    Map<String, Map<String, String>> result = new HashMap<String, Map<String, String>>();
+    Map<String, Map<String, String>> result = new HashMap<>();
     for (String moduleId : moduleIds) {
       result.putAll(extractPropertiesByModule(moduleId, currentModuleProperties));
     }
@@ -445,7 +445,7 @@ public class ProjectReactorBuilder {
       dirPath = pattern.substring(0, i);
       filePattern = pattern.substring(i + 1);
     }
-    List<IOFileFilter> filters = new ArrayList<IOFileFilter>();
+    List<IOFileFilter> filters = new ArrayList<>();
     if (pattern.indexOf('*') >= 0) {
       filters.add(FileFileFilter.FILE);
     }
index 88970aa75daed269f7c5ecd3edec8038aaa83f4d..208b576648368f978ffdba56ac4d4a09af33ae58 100644 (file)
@@ -61,7 +61,7 @@ public class ProjectReactorValidator {
     String branch = settings.getString(CoreProperties.PROJECT_BRANCH_PROPERTY);
     String rootProjectKey = ComponentKeys.createKey(reactor.getRoot().getKey(), branch);
 
-    List<String> validationMessages = new ArrayList<String>();
+    List<String> validationMessages = new ArrayList<>();
     checkDeprecatedProperties(validationMessages);
 
     for (ProjectDefinition moduleDef : reactor.getProjects()) {
index c45dd6464953675e30112641a2df8675ef068cd8..5809addf3f5eaa80beda6e353e03af34a0484012 100644 (file)
@@ -122,7 +122,7 @@ public class DefaultModuleFileSystem extends DefaultFileSystem implements Module
   }
 
   private List<File> keepOnlyDirs(List<File> dirsOrFiles) {
-    List<File> result = new ArrayList<File>();
+    List<File> result = new ArrayList<>();
     for (File f : dirsOrFiles) {
       if (f.isDirectory()) {
         result.add(f);
index 0e5dec4bbad185f50ba18e4027165de6656f0943..87527835a812e4bbe182a224d1c2aec6878dc39d 100644 (file)
@@ -90,7 +90,7 @@ public class FileIndexer {
 
     InputFileBuilder inputFileBuilder = inputFileBuilderFactory.create(fileSystem);
     executorService = Executors.newFixedThreadPool(Math.max(1, Runtime.getRuntime().availableProcessors() - 1));
-    tasks = new ArrayList<Future<Void>>();
+    tasks = new ArrayList<>();
     indexFiles(fileSystem, progress, inputFileBuilder, fileSystem.sources(), InputFile.Type.MAIN);
     indexFiles(fileSystem, progress, inputFileBuilder, fileSystem.tests(), InputFile.Type.TEST);
 
index fb23eed4c21af4cc3347ab04aba9e041bff45bbb..5604537b15f218bfb0b23ef4378e4b516cea34f9 100644 (file)
@@ -75,11 +75,11 @@ public class IssuesReport {
   }
 
   public List<ResourceReport> getResourceReports() {
-    return new ArrayList<ResourceReport>(resourceReportsByResource.values());
+    return new ArrayList<>(resourceReportsByResource.values());
   }
 
   public List<BatchResource> getResourcesWithReport() {
-    return new ArrayList<BatchResource>(resourceReportsByResource.keySet());
+    return new ArrayList<>(resourceReportsByResource.keySet());
   }
 
   public void addIssueOnResource(BatchResource resource, Issue issue, Rule rule, RulePriority severity) {
index 3025da02f0d286f36eca7e45c8639543c6b7497a..11b8be7a45696dc0183695cd67dba1b2e45b96d9 100644 (file)
@@ -122,7 +122,7 @@ public class JSONReport implements Reporter {
       writeJsonIssues(json, ruleKeys, userLogins);
       writeJsonComponents(json);
       writeJsonRules(json, ruleKeys);
-      Collection<BatchInput.User> users = userRepository.loadFromWs(new ArrayList<String>(userLogins));
+      Collection<BatchInput.User> users = userRepository.loadFromWs(new ArrayList<>(userLogins));
       writeUsers(json, users);
       json.endObject().close();
 
index 192d8f0d9d1b6e6885c3cda1a15bd1ca900efa60..18e964fa262b1fa47f2ffe421a6ea8f06d66ef16 100644 (file)
@@ -89,7 +89,7 @@ public class ReportSummary {
   }
 
   public List<RuleReport> getRuleReports() {
-    List<RuleReport> result = new ArrayList<RuleReport>(ruleReportByRuleKey.values());
+    List<RuleReport> result = new ArrayList<>(ruleReportByRuleKey.values());
     Collections.sort(result, new RuleReportComparator());
     return result;
   }
index 18a7fc8a1e38d8f24edb4e8b8671111c29ee1cac..e48ffc3e40ae23042ed3aac3ac2f8ed65ab2827e 100644 (file)
@@ -36,7 +36,7 @@ public final class ResourceReport {
   private final IssueVariation total = new IssueVariation();
   private final Map<ReportRuleKey, RuleReport> ruleReportByRuleKey = Maps.newHashMap();
 
-  private List<Issue> issues = new ArrayList<Issue>();
+  private List<Issue> issues = new ArrayList<>();
   private Map<Integer, List<Issue>> issuesPerLine = Maps.newHashMap();
   private Map<Integer, List<Issue>> newIssuesPerLine = Maps.newHashMap();
   private Map<Rule, AtomicInteger> issuesByRule = Maps.newHashMap();
@@ -146,7 +146,7 @@ public final class ResourceReport {
   }
 
   public List<RuleReport> getRuleReports() {
-    List<RuleReport> result = new ArrayList<RuleReport>(ruleReportByRuleKey.values());
+    List<RuleReport> result = new ArrayList<>(ruleReportByRuleKey.values());
     Collections.sort(result, new RuleReportComparator());
     return result;
   }
index 1f913e2b63f2705926fd3a59d7a47d13cb8488fc..bbe6106df06bbac50be51ca30842fbf5f2a568e3 100644 (file)
@@ -54,7 +54,7 @@ public class SourceProvider {
     try {
       InputFile inputFile = (InputFile) inputPathCache.getInputPath(component);
       List<String> lines = FileUtils.readLines(inputFile.file(), fs.encoding());
-      List<String> escapedLines = new ArrayList<String>(lines.size());
+      List<String> escapedLines = new ArrayList<>(lines.size());
       for (String line : lines) {
         escapedLines.add(StringEscapeUtils.escapeHtml(line));
       }
index d369b9efec14fca820d3c3061c603cb1ff91e95b..399d2d3779f636fb38f569ae08ff6307394ff5d5 100644 (file)
@@ -49,7 +49,7 @@ class DefaultBlameOutput implements BlameOutput {
 
   private final BatchReportWriter writer;
   private final ResourceCache componentCache;
-  private final Set<InputFile> allFilesToBlame = new HashSet<InputFile>();
+  private final Set<InputFile> allFilesToBlame = new HashSet<>();
   private ProgressReport progressReport;
   private int count;
   private int total;
index 526316f16f2b1a03ed03dd4a75e5189eeec729f2..19e3abacd97a6abf0b0140b03e1b174ed7281761 100644 (file)
@@ -59,7 +59,7 @@ public final class ScmConfiguration implements Startable {
 
   private final ProjectReactor projectReactor;
   private final Settings settings;
-  private final Map<String, ScmProvider> providerPerKey = new LinkedHashMap<String, ScmProvider>();
+  private final Map<String, ScmProvider> providerPerKey = new LinkedHashMap<>();
   private final AnalysisMode analysisMode;
 
   private ScmProvider provider;
index 51365f6d5c64d266727bc648e6fbd8ec23f8b209..24492bbdc7828a3d54849035fe8cbcddf3a6fb7a 100644 (file)
@@ -91,7 +91,7 @@ public final class ScmSensor implements Sensor {
     if (configuration.forceReloadAll()) {
       LOG.warn("Forced reloading of SCM data for all files.");
     }
-    List<InputFile> filesToBlame = new LinkedList<InputFile>();
+    List<InputFile> filesToBlame = new LinkedList<>();
     for (InputFile f : fs.inputFiles(fs.predicates().all())) {
       if (configuration.forceReloadAll()) {
         addIfNotEmpty(filesToBlame, f);
index c8eb840272f32236b5508fe7fe5d4afc8cb8d400..46dbef1bc9343bd26b7bac7f67eda14b9945d753 100644 (file)
@@ -53,7 +53,7 @@ public class CodeColorizers {
   private final Map<String, CodeColorizerFormat> byLang;
 
   public CodeColorizers(List<CodeColorizerFormat> formats) {
-    byLang = new HashMap<String, CodeColorizerFormat>();
+    byLang = new HashMap<>();
     for (CodeColorizerFormat format : formats) {
       byLang.put(format.getLanguageKey(), format);
     }
index 2ab9999bf1be96b51433c6fefbf2dd6aec1d7e7c..e2bbf13bfa891b43ffd5505e0b57d7d3e94e8408 100644 (file)
@@ -41,7 +41,7 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable {
 
   @Override
   public List<Symbol> symbols() {
-    List<Symbol> result = new ArrayList<Symbol>();
+    List<Symbol> result = new ArrayList<>();
     for (Symbol symbol : referencesBySymbol.keySet()) {
       result.add((Symbol) symbol);
     }
@@ -55,7 +55,7 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable {
 
   public static class Builder implements Symbolizable.SymbolTableBuilder {
 
-    private final Map<Symbol, Set<TextRange>> referencesBySymbol = new LinkedHashMap<Symbol, Set<TextRange>>();
+    private final Map<Symbol, Set<TextRange>> referencesBySymbol = new LinkedHashMap<>();
     private final DefaultInputFile inputFile;
 
     public Builder(DefaultInputFile inputFile) {
@@ -66,7 +66,7 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable {
     public Symbol newSymbol(int fromOffset, int toOffset) {
       TextRange declarationRange = inputFile.newRange(fromOffset, toOffset);
       DefaultSymbol symbol = new DefaultSymbol(declarationRange, toOffset - fromOffset);
-      referencesBySymbol.put(symbol, new TreeSet<TextRange>(new Comparator<TextRange>() {
+      referencesBySymbol.put(symbol, new TreeSet<>(new Comparator<TextRange>() {
         @Override
         public int compare(TextRange o1, TextRange o2) {
           return o1.start().compareTo(o2.start());
index 6858d6de1f02344c41c3d02cc012b9bf5eef27dc..dca733fd1f85366bcbbd1066fcf50783f37e3c4c 100644 (file)
@@ -32,7 +32,7 @@ import java.util.List;
 public class HighlightingRenderer {
 
   public void render(Reader code, List<? extends Channel<HtmlCodeBuilder>> tokenizers, NewHighlighting highlighting) {
-    List<Channel<HtmlCodeBuilder>> allTokenizers = new ArrayList<Channel<HtmlCodeBuilder>>();
+    List<Channel<HtmlCodeBuilder>> allTokenizers = new ArrayList<>();
     HighlightingCodeBuilder codeBuilder = new HighlightingCodeBuilder(highlighting);
 
     allTokenizers.addAll(tokenizers);
index 7cc8ca87bc1c3be93ae447dba18de2064cdda23b..e24265ab7cf8f63bd8e0fed0764a7464f0c686fc 100644 (file)
@@ -139,7 +139,7 @@ public class DirectoryDsmDecoratorTest {
     when(index.getOutgoingEdges(file1)).thenReturn(Arrays.asList(dependency));
     when(index.getIncomingEdges(file2)).thenReturn(Arrays.asList(dependency));
 
-    List<DecoratorContext> contexts = new ArrayList<DecoratorContext>(201);
+    List<DecoratorContext> contexts = new ArrayList<>(201);
     contexts.add(file1Context);
     contexts.add(file2Context);
     for (int i = 0; i < 199; i++) {
index 5d9b0b508ef0d8478b7fa3a14b998ecf82bd2fc6..5d807287771742f1fb5d42160c5ab245975962bb 100644 (file)
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertThat;
 public class DsmSerializerTest {
   @Test
   public void serializeEmptyDsm() {
-    Dsm<Resource> dsm = new Dsm<Resource>(new DirectedGraph<Resource, Edge<Resource>>());
+    Dsm<Resource> dsm = new Dsm<>(new DirectedGraph<Resource, Edge<Resource>>());
     assertThat(DsmSerializer.serialize(dsm), is("[]"));
   }
 
@@ -47,12 +47,12 @@ public class DsmSerializerTest {
     Resource bar = Directory.create("src/org/bar").setId(8);
     Dependency dep = new Dependency(foo, bar).setId(30l).setWeight(1);
 
-    DirectedGraph<Resource, Dependency> graph = new DirectedGraph<Resource, Dependency>();
+    DirectedGraph<Resource, Dependency> graph = new DirectedGraph<>();
     graph.addVertex(foo);
     graph.addVertex(bar);
     graph.addEdge(dep);
 
-    Dsm<Resource> dsm = new Dsm<Resource>(graph);
+    Dsm<Resource> dsm = new Dsm<>(graph);
     DsmManualSorter.sort(dsm, bar, foo); // for test reproductibility
     String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/batch/design/DsmSerializerTest/dsm.json")).trim();
     assertThat(DsmSerializer.serialize(dsm), is(json));
index 8849aadf68a905d76e62bdcd31a9a391e5825649..0fdd3d515343698f50f266de2761b14d3774bf4d 100644 (file)
@@ -341,7 +341,7 @@ public class ProjectReactorBuilderTest {
 
   @Test
   public void shouldFailIfMandatoryPropertiesAreNotPresent() {
-    Map<String, String> props = new HashMap<String, String>();
+    Map<String, String> props = new HashMap<>();
     props.put("foo1", "bla");
     props.put("foo4", "bla");
 
@@ -353,7 +353,7 @@ public class ProjectReactorBuilderTest {
 
   @Test
   public void shouldFailIfMandatoryPropertiesAreNotPresentButWithProjectKey() {
-    Map<String, String> props = new HashMap<String, String>();
+    Map<String, String> props = new HashMap<>();
     props.put("foo1", "bla");
     props.put("sonar.projectKey", "my-project");
 
@@ -365,7 +365,7 @@ public class ProjectReactorBuilderTest {
 
   @Test
   public void shouldNotFailIfMandatoryPropertiesArePresent() {
-    Map<String, String> props = new HashMap<String, String>();
+    Map<String, String> props = new HashMap<>();
     props.put("foo1", "bla");
     props.put("foo4", "bla");
 
@@ -410,13 +410,13 @@ public class ProjectReactorBuilderTest {
     int i = (int) Math.random() * 10;
     String s1 = "value" + i;
     String s2 = "value" + i;
-    Map<String, String> parentProps = new HashMap<String, String>();
+    Map<String, String> parentProps = new HashMap<>();
     parentProps.put("toBeMergeProps", "fooParent");
     parentProps.put("existingChildProp", "barParent");
     parentProps.put("duplicatedProp", s1);
     parentProps.put("sonar.projectDescription", "Desc from Parent");
 
-    Map<String, String> childProps = new HashMap<String, String>();
+    Map<String, String> childProps = new HashMap<>();
     childProps.put("existingChildProp", "barChild");
     childProps.put("otherProp", "tutuChild");
     childProps.put("duplicatedProp", s2);
@@ -492,7 +492,7 @@ public class ProjectReactorBuilderTest {
 
   @Test
   public void shouldSetModuleKeyIfNotPresent() {
-    Map<String, String> props = new HashMap<String, String>();
+    Map<String, String> props = new HashMap<>();
     props.put("sonar.projectVersion", "1.0");
 
     // should be set
@@ -532,7 +532,7 @@ public class ProjectReactorBuilderTest {
   }
 
   public Map<String, String> toMap(Properties props) {
-    Map<String, String> result = new HashMap<String, String>();
+    Map<String, String> result = new HashMap<>();
     for (Map.Entry<Object, Object> entry : props.entrySet()) {
       result.put(entry.getKey().toString(), entry.getValue().toString());
     }
@@ -541,7 +541,7 @@ public class ProjectReactorBuilderTest {
 
   @Test
   public void shouldGetList() {
-    Map<String, String> props = new HashMap<String, String>();
+    Map<String, String> props = new HashMap<>();
 
     props.put("prop", "  foo  ,  bar  , \n\ntoto,tutu");
     assertThat(ProjectReactorBuilder.getListFromProperty(props, "prop")).containsOnly("foo", "bar", "toto", "tutu");
@@ -635,7 +635,7 @@ public class ProjectReactorBuilderTest {
     try (FileInputStream fileInputStream = new FileInputStream(TestUtils.getResource(this.getClass(), filePath))) {
       props.load(fileInputStream);
     }
-    Map<String, String> result = new HashMap<String, String>();
+    Map<String, String> result = new HashMap<>();
     for (Map.Entry<Object, Object> entry : props.entrySet()) {
       result.put(entry.getKey().toString(), entry.getValue().toString());
     }
index a95a43489916005b4fe20eec46834813a984ce4b..7e3d42436faefae0e065864784506322c27eddc6 100644 (file)
@@ -45,7 +45,7 @@ public class HtmlRenderer extends Renderer {
   @Override
   public String render(Reader code, List<? extends Channel<HtmlCodeBuilder>> tokenizers) {
     try {
-      List<Channel<HtmlCodeBuilder>> allTokenizers = new ArrayList<Channel<HtmlCodeBuilder>>();
+      List<Channel<HtmlCodeBuilder>> allTokenizers = new ArrayList<>();
       HtmlCodeBuilder codeBuilder = new HtmlCodeBuilder();
       HtmlDecorator htmlDecorator = new HtmlDecorator(options);
 
index 06025a33d3735caff4000a548a20d8db3024d6da..3a175633d0a93f5c4d6de17b660c77bda8e17297 100644 (file)
@@ -40,7 +40,7 @@ public class KeywordsTokenizer extends NotThreadSafeTokenizer {
   private final StringBuilder tmpBuilder = new StringBuilder();
   private static final String DEFAULT_REGEX = "[a-zA-Z_][a-zA-Z0-9_]*+";
 
-  private Set<String> keywords = new HashSet<String>();
+  private Set<String> keywords = new HashSet<>();
 
   public KeywordsTokenizer(String tagBefore, String tagAfter, Set<String> keywords) {
     this(tagBefore, tagAfter, keywords, DEFAULT_REGEX);
index ed30d457e95d5ba2f7e10798665a549d8d8819da..d3a5c4cb217afa6c09f7ea1b1b6696816339a3ec 100644 (file)
@@ -102,7 +102,7 @@ public class CodeColorizerTest {
       }
     }
 
-    Collection<Callable<String>> tasks = new ArrayList<Callable<String>>();
+    Collection<Callable<String>> tasks = new ArrayList<>();
     for (int i = 0; i < taskCount; i++) {
       tasks.add(new ColorizerTask());
     }
index ce76fe74c2a69cebf531f51055a3e230b691c9e5..d02a13b01fbc82a3e50f035a3b4cca164f14a751 100644 (file)
@@ -69,7 +69,7 @@ public class ScanGraph extends BeanGraph {
 
   public Iterable<ComponentVertex> getComponents() {
     Iterable<Vertex> componentVertices = componentsRoot.getVertices(Direction.OUT, COMPONENT);
-    return new BeanIterable<ComponentVertex>(this, ComponentVertex.class, componentVertices);
+    return new BeanIterable<>(this, ComponentVertex.class, componentVertices);
   }
 
   public ComponentVertex addComponent(Component component) {
index 749efd22222c47afe39ff496980436350f5de980..d1f544b144b49ba1912f4bb149df78eb1076f13c 100644 (file)
@@ -25,10 +25,10 @@ import com.tinkerpop.blueprints.Vertex;
 public abstract class BeanVertex extends BeanElement<Vertex, BeanVertex> {
 
   protected final <T extends BeanEdge> Iterable<T> getEdges(Class<T> edgeClass, Direction direction, String... labels) {
-    return new BeanIterable<T>(beanGraph(), edgeClass, element().getEdges(direction, labels));
+    return new BeanIterable<>(beanGraph(), edgeClass, element().getEdges(direction, labels));
   }
 
   protected final <T extends BeanVertex> Iterable<T> getVertices(Class<T> vertexClass, Direction direction, String... labels) {
-    return new BeanIterable<T>(beanGraph(), vertexClass, element().getVertices(direction, labels));
+    return new BeanIterable<>(beanGraph(), vertexClass, element().getVertices(direction, labels));
   }
 }
index 616311620614a95b0bfba89684c62918c81efb82..241d26451408947e89bbda053548f8c3f194020f 100644 (file)
@@ -224,7 +224,7 @@ class GraphsonUtil {
   }
 
   static Map<String, Object> readProperties(JSONObject node, boolean ignoreReservedKeys, boolean hasEmbeddedTypes) {
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
 
     for (Object objKey : node.keySet()) {
       String key = (String) objKey;
@@ -398,7 +398,7 @@ class GraphsonUtil {
   }
 
   private static Map createPropertyMap(Element element, Set<String> propertyKeys, ElementPropertiesRule rule) {
-    Map map = new HashMap<String, Object>();
+    Map map = new HashMap<>();
 
     if (propertyKeys == null) {
       for (String key : element.getPropertyKeys()) {
index 0d8399f6cfdcd360e5f2d2cbba184516cffab731..5e849618486ad14f7b6e5c324019947ef3cdc3b9 100644 (file)
@@ -214,7 +214,7 @@ public class PermissionFacade {
    */
   private String getApplicablePermissionTemplateKey(DbSession session, final String componentKey, String qualifier) {
     List<PermissionTemplateDto> allPermissionTemplates = permissionTemplateDao.selectAllPermissionTemplates(session);
-    List<PermissionTemplateDto> matchingTemplates = new ArrayList<PermissionTemplateDto>();
+    List<PermissionTemplateDto> matchingTemplates = new ArrayList<>();
     for (PermissionTemplateDto permissionTemplateDto : allPermissionTemplates) {
       String keyPattern = permissionTemplateDto.getKeyPattern();
       if (StringUtils.isNotBlank(keyPattern) && componentKey.matches(keyPattern)) {
index 503d302112fb7dee496f8ad8e0b2777651f5af0a..63a7f6b856d11f7d0d4fbf8729ad8ccee77d8d73 100644 (file)
@@ -44,7 +44,7 @@ public class DbSession implements SqlSession {
     this.actionCount = 0;
     this.session = session;
     this.queue = queue;
-    this.actions = new ArrayList<ClusterAction>();
+    this.actions = new ArrayList<>();
   }
 
   public void enqueue(ClusterAction action) {
index a294dce2a6be4af3be6f942ff6e2f765f0ef55dd..9f211cbd35ab64e217ce1c1e84e79b35369cbad4 100644 (file)
@@ -134,7 +134,7 @@ public class PurgeDao {
   }
 
   private void disableOrphanResources(final ResourceDto project, final SqlSession session, final PurgeMapper purgeMapper, final PurgeListener purgeListener) {
-    final List<IdUuidPair> componentIdUuids = new ArrayList<IdUuidPair>();
+    final List<IdUuidPair> componentIdUuids = new ArrayList<>();
     session.select("org.sonar.core.purge.PurgeMapper.selectComponentIdUuidsToDisable", project.getId(), new ResultHandler() {
       @Override
       public void handleResult(ResultContext resultContext) {
index e3552b5b66cded12f58ecc8bf387cb86b236a1c2..96c03fe4112eb3ed161c45432800ce6e89c50a7e 100644 (file)
@@ -33,7 +33,7 @@ import java.util.Map.Entry;
 
 public class PurgeProfiler {
 
-  private Map<String, Long> durations = new HashMap<String, Long>();
+  private Map<String, Long> durations = new HashMap<>();
   private long startTime;
   private String currentTable;
   private final Clock clock;
@@ -67,7 +67,7 @@ public class PurgeProfiler {
   }
 
   public void dump(long totalTime, Logger logger) {
-    List<Entry<String, Long>> data = new ArrayList<Map.Entry<String, Long>>(durations.entrySet());
+    List<Entry<String, Long>> data = new ArrayList<>(durations.entrySet());
     Collections.sort(data, new Comparator<Entry<String, Long>>() {
       @Override
       public int compare(Entry<String, Long> o1, Entry<String, Long> o2) {
@@ -85,7 +85,7 @@ public class PurgeProfiler {
 
   private List<Entry<String, Long>> truncateList(List<Entry<String, Long>> sortedFullList) {
     int maxSize = 10;
-    List<Entry<String, Long>> result = new ArrayList<Entry<String, Long>>(maxSize);
+    List<Entry<String, Long>> result = new ArrayList<>(maxSize);
     int i = 0;
     for (Entry<String, Long> item : sortedFullList) {
       if (i++ >= maxSize || item.getValue() == 0) {
index 70bc208b4f4ff18bbc6d3f63ce27b0cba4b5c8c5..630adc21a842d17b82fc20967fe50627976a7da7 100644 (file)
@@ -96,7 +96,7 @@ public class ActiveRuleParamDto {
   }
 
   public static Map<String,ActiveRuleParamDto> groupByKey(Collection<ActiveRuleParamDto> params) {
-    Map<String, ActiveRuleParamDto> result = new HashMap<String, ActiveRuleParamDto>();
+    Map<String, ActiveRuleParamDto> result = new HashMap<>();
     for (ActiveRuleParamDto param : params) {
       result.put(param.getKey(), param);
     }
index 564acb64baabb12ab3a676dcb0d80bed652753cd..a027c98aa40e46c90e47a69f40a98548f41ec483 100644 (file)
@@ -120,7 +120,7 @@ public final class CacheRuleFinder implements RuleFinder {
 
   private Query createHqlQuery(DatabaseSession session, RuleQuery query) {
     StringBuilder hql = new StringBuilder().append("from ").append(Rule.class.getSimpleName()).append(" where status<>:status ");
-    Map<String, Object> params = new HashMap<String, Object>();
+    Map<String, Object> params = new HashMap<>();
     params.put("status", Rule.STATUS_REMOVED);
     if (StringUtils.isNotBlank(query.getRepositoryKey())) {
       hql.append("AND pluginName=:repositoryKey ");
index 9b1fff40e278700cc83967ab684af039fdd3ec4b..bbfd1f0b86304e0319e85a748ab61020b9e43155 100644 (file)
@@ -328,13 +328,13 @@ public class RuleDto extends Dto<RuleKey> {
   public Set<String> getTags() {
     return tags == null ?
       new HashSet<String>() :
-      new TreeSet<String>(Arrays.asList(StringUtils.split(tags, ',')));
+      new TreeSet<>(Arrays.asList(StringUtils.split(tags, ',')));
   }
 
   public Set<String> getSystemTags() {
     return systemTags == null ?
       new HashSet<String>() :
-      new TreeSet<String>(Arrays.asList(StringUtils.split(systemTags, ',')));
+      new TreeSet<>(Arrays.asList(StringUtils.split(systemTags, ',')));
   }
 
   private String getTagsField() {
index 1cc6d0b9cfb1dff1c72472e4e5f2afa90955aba3..1ed2f16042a8334730bda89d7118afc6854c601d 100644 (file)
@@ -34,7 +34,7 @@ import static com.google.common.collect.Lists.newArrayList;
 public class MeasuresDao {
 
   private final DatabaseSession session;
-  private final Map<String, Metric> metricsByName = new HashMap<String, Metric>();
+  private final Map<String, Metric> metricsByName = new HashMap<>();
 
   public MeasuresDao(DatabaseSession session) {
     this.session = session;
index e97b35176d7f3801732beac014960a327acea43d..ab43555dd4f46cde89bc5f23ea570bd815ba813d 100644 (file)
@@ -213,7 +213,7 @@ public class JpaDatabaseSession extends DatabaseSession {
       return defaultValue;
 
     } else {
-      Set<T> uniqueResult = new HashSet<T>(result);
+      Set<T> uniqueResult = new HashSet<>(result);
       if (uniqueResult.size() > 1) {
         throw new NonUniqueResultException("Expected single result, but got : " + result.toString());
       } else {
index 9d4a05efcb0734d602b63aff0b8a47ad34300eb8..661598b37cd628682514fbfb66f387c7348e1e8c 100644 (file)
@@ -23,7 +23,7 @@ import org.sonar.api.database.DatabaseSession;
 
 public class ThreadLocalDatabaseSessionFactory implements DatabaseSessionFactory {
 
-  private final ThreadLocal<JpaDatabaseSession> threadSession = new ThreadLocal<JpaDatabaseSession>();
+  private final ThreadLocal<JpaDatabaseSession> threadSession = new ThreadLocal<>();
   private final DatabaseConnector connector;
 
   public ThreadLocalDatabaseSessionFactory(DatabaseConnector connector) {
index c877a1493bcda6c2f5dded680b74edceec74257c..b63cd4de9409fa260c588878c587c021be416e3f 100644 (file)
@@ -235,7 +235,7 @@ public class GraphsonReaderTest {
 
     StringWriter stream = new StringWriter();
 
-    Set<String> edgeKeys = new HashSet<String>();
+    Set<String> edgeKeys = new HashSet<>();
     edgeKeys.add(GraphsonTokens._ID);
     edgeKeys.add(GraphsonTokens._IN_V);
     edgeKeys.add(GraphsonTokens._OUT_V);
@@ -293,7 +293,7 @@ public class GraphsonReaderTest {
 
     StringWriter stream = new StringWriter();
 
-    Set<String> edgeKeys = new HashSet<String>();
+    Set<String> edgeKeys = new HashSet<>();
     edgeKeys.add(GraphsonTokens._IN_V);
     edgeKeys.add(GraphsonTokens._OUT_V);
     edgeKeys.add(GraphsonTokens._LABEL);
index 6fb3611a9ef55e358e4531a41a4f299a81c2bb2e..e021175f8102fef98ec9a23bbbc245f5651bb284 100644 (file)
@@ -288,7 +288,7 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexListPropertyNoKeysNoTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<Object> list = new ArrayList<Object>();
+    List<Object> list = new ArrayList<>();
     list.add("this");
     list.add("that");
     list.add("other");
@@ -447,7 +447,7 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexCatArrayPropertyNoKeysNoTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<Cat> cats = new ArrayList<Cat>();
+    List<Cat> cats = new ArrayList<>();
     cats.add(new Cat("smithers"));
     cats.add(new Cat("mcallister"));
 
@@ -521,7 +521,7 @@ public class GraphsonUtilTest {
     v.setProperty("y", "Y");
     v.setProperty("z", "Z");
 
-    Set<String> propertiesToInclude = new HashSet<String>();
+    Set<String> propertiesToInclude = new HashSet<>();
     propertiesToInclude.add("y");
     JSONObject json = GraphsonUtil.jsonFromElement(v, propertiesToInclude, GraphsonMode.NORMAL);
 
@@ -547,7 +547,7 @@ public class GraphsonUtilTest {
 
     v.setProperty("v", innerV);
 
-    Set<String> propertiesToInclude = new HashSet<String>();
+    Set<String> propertiesToInclude = new HashSet<>();
     propertiesToInclude.add("y");
     propertiesToInclude.add("v");
 
@@ -624,7 +624,7 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexListPropertiesNoKeysWithTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<String> list = new ArrayList<String>();
+    List<String> list = new ArrayList<>();
     list.add("this");
     list.add("this");
     list.add("this");
@@ -659,7 +659,7 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexBooleanListPropertiesNoKeysWithTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<Boolean> list = new ArrayList<Boolean>();
+    List<Boolean> list = new ArrayList<>();
     list.add(true);
     list.add(true);
     list.add(true);
@@ -694,7 +694,7 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexLongListPropertiesNoKeysWithTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<Long> list = new ArrayList<Long>();
+    List<Long> list = new ArrayList<>();
     list.add(1000L);
     list.add(1000L);
     list.add(1000L);
@@ -729,7 +729,7 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexIntListPropertiesNoKeysWithTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<Integer> list = new ArrayList<Integer>();
+    List<Integer> list = new ArrayList<>();
     list.add(1);
     list.add(1);
     list.add(1);
@@ -764,12 +764,12 @@ public class GraphsonUtilTest {
   @Test
   public void jsonFromElementVertexListOfListPropertiesNoKeysWithTypes() {
     Vertex v = this.graph.addVertex(1);
-    List<Integer> list = new ArrayList<Integer>();
+    List<Integer> list = new ArrayList<>();
     list.add(1);
     list.add(1);
     list.add(1);
 
-    List<List<Integer>> listList = new ArrayList<List<Integer>>();
+    List<List<Integer>> listList = new ArrayList<>();
     listList.add(list);
 
     v.setProperty("keyList", listList);
@@ -846,17 +846,17 @@ public class GraphsonUtilTest {
     Vertex v = g.addVertex(1);
     v.setProperty("key", null);
 
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
     map.put("innerkey", null);
 
-    List<String> innerList = new ArrayList<String>();
+    List<String> innerList = new ArrayList<>();
     innerList.add(null);
     innerList.add("innerstring");
     map.put("list", innerList);
 
     v.setProperty("keyMap", map);
 
-    List<String> list = new ArrayList<String>();
+    List<String> list = new ArrayList<>();
     list.add(null);
     list.add("string");
     v.setProperty("keyList", list);
@@ -888,17 +888,17 @@ public class GraphsonUtilTest {
     Vertex v = g.addVertex(1);
     v.setProperty("key", null);
 
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
     map.put("innerkey", null);
 
-    List<String> innerList = new ArrayList<String>();
+    List<String> innerList = new ArrayList<>();
     innerList.add(null);
     innerList.add("innerstring");
     map.put("list", innerList);
 
     v.setProperty("keyMap", map);
 
-    List<String> list = new ArrayList<String>();
+    List<String> list = new ArrayList<>();
     list.add(null);
     list.add("string");
     v.setProperty("keyList", list);
@@ -998,7 +998,7 @@ public class GraphsonUtilTest {
     Graph g = new TinkerGraph();
     ElementFactory factory = new ElementFactory(g);
 
-    Set<String> ignoreAge = new HashSet<String>();
+    Set<String> ignoreAge = new HashSet<>();
     ignoreAge.add("age");
     ElementPropertyConfig config = ElementPropertyConfig.excludeProperties(ignoreAge, null);
     GraphsonUtil utility = new GraphsonUtil(GraphsonMode.NORMAL, factory, config);
@@ -1062,7 +1062,7 @@ public class GraphsonUtilTest {
     Vertex v1 = GraphsonUtil.vertexFromJson((JSONObject) JSONValue.parse(vertexJson1), factory, GraphsonMode.NORMAL, null);
     Vertex v2 = GraphsonUtil.vertexFromJson((JSONObject) JSONValue.parse(vertexJson2), factory, GraphsonMode.NORMAL, null);
 
-    Set<String> ignoreWeight = new HashSet<String>();
+    Set<String> ignoreWeight = new HashSet<>();
     ignoreWeight.add("weight");
     ElementPropertyConfig config = ElementPropertyConfig.excludeProperties(null, ignoreWeight);
     GraphsonUtil utility = new GraphsonUtil(GraphsonMode.NORMAL, factory, config);
index dbd6cc9addc4ddd74c48d7d074d898e6c6a936e8..e898e621f2106229a721c1faf13dc7bbf69639bf 100644 (file)
@@ -67,7 +67,7 @@ public class ChartParameters {
    * @param  queryString string
    */
   public ChartParameters(String queryString) {
-    this.params = new HashMap<String, String>();
+    this.params = new HashMap<>();
     String[] groups = StringUtils.split(queryString, "&");
     for (String group : groups) {
       String[] keyval = StringUtils.split(group, "=");
index ed1752d49c52be47ee59d1c9c35b177f888a9dd5..b7a0a3772c307b64f848461daa1152e39eb3dbd3 100644 (file)
@@ -98,7 +98,7 @@ public final class XMLRuleParser {
     try {
       SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader);
       rootC.advance(); // <rules>
-      List<Rule> rules = new ArrayList<Rule>();
+      List<Rule> rules = new ArrayList<>();
 
       SMInputCursor rulesC = rootC.childElementCursor("rule");
       while (rulesC.getNext() != null) {
index d2d098b9402bdfcc60fbe7be89c4f2358507e941..8656fa5d48ae3caaa5f1e8e1a114b089aca1cf61 100644 (file)
@@ -52,7 +52,7 @@ public class NoSonarFilterTest {
 
   @Test
   public void ignoreLinesCommentedWithNoSonar() {
-    Set<Integer> noSonarLines = new HashSet<Integer>();
+    Set<Integer> noSonarLines = new HashSet<>();
     noSonarLines.add(31);
     noSonarLines.add(55);
     filter.addResource(javaFile, noSonarLines);
@@ -75,7 +75,7 @@ public class NoSonarFilterTest {
   public void should_accept_violations_from_no_sonar_rules() {
     // The "No Sonar" rule logs violations on the lines that are flagged with "NOSONAR" !!
 
-    Set<Integer> noSonarLines = new HashSet<Integer>();
+    Set<Integer> noSonarLines = new HashSet<>();
     noSonarLines.add(31);
     filter.addResource(javaFile, noSonarLines);
 
index cf886d01122d5a8a2490eb8facf9b9e7a5743790..57501d25d7a1a4183a6db5d0416f4d6845e990b8 100644 (file)
@@ -50,7 +50,7 @@ public class SourceCode {
       if (c != null) {
         return c;
       }
-      this.code = new SoftReference<List<String>>(load());
+      this.code = new SoftReference<>(load());
       return code.get();
     }
 
@@ -62,7 +62,7 @@ public class SourceCode {
       LineNumberReader lnr = null;
       try {
         lnr = new LineNumberReader(getReader());
-        List<String> lines = new ArrayList<String>();
+        List<String> lines = new ArrayList<>();
         String currentLine;
         while ((currentLine = lnr.readLine()) != null) {
           lines.add(currentLine);
index be1bfb4bc837b6731a765f4178a2161d8aef4db7..395c9f9bdc29db86293a8936656eb8d0c5eb6b07 100644 (file)
@@ -34,7 +34,7 @@ import java.util.Map;
  */
 public class TokenEntry implements Comparable<TokenEntry> {
 
-  private static final Map<String, Integer> TOKENS = new HashMap<String, Integer>();
+  private static final Map<String, Integer> TOKENS = new HashMap<>();
   private static int tokenCount = 0;
 
   /**
index 0a13ccf1b294b841ec6f15683de70b9d51730942..6c3dde2496cede6bfe3ceef275cb5827182f5d76 100644 (file)
@@ -27,7 +27,7 @@ public abstract class AbstractText implements Text {
   protected final List<Object> symbols;
 
   public AbstractText(int size) {
-    this.symbols = new ArrayList<Object>(size);
+    this.symbols = new ArrayList<>(size);
   }
 
   public AbstractText(List<Object> symbols) {
index c94a89b407f15ab5bd044e7da716315a86e80e13..c6a95c9cae1aaa17f66291802839366d8907bc1b 100644 (file)
@@ -54,7 +54,7 @@ public final class Node {
   public Node(SuffixTree suffixTree, Node suffixNode) {
     this.suffixTree = suffixTree;
     this.suffixNode = suffixNode;
-    edges = new HashMap<Object, Edge>();
+    edges = new HashMap<>();
   }
 
   public Object symbolAt(int index) {
index 01b7273da1cb83bb17a3b0814d3ccf6608bdb83f..05eab3dd10812652018f01370c0f1ad981a7590f 100644 (file)
@@ -55,7 +55,7 @@ public class CloneGroup {
     private ClonePart origin;
     private int length;
     private int lengthInUnits;
-    private List<ClonePart> parts = new ArrayList<ClonePart>();
+    private List<ClonePart> parts = new ArrayList<>();
 
     public Builder setLength(int length) {
       this.length = length;
index d734b5dfa0af508d1807fb69e77f635c8c621c98..39d45ede76b6b06acc9be56f277967e98672e4e5 100644 (file)
@@ -48,7 +48,7 @@ public final class StatementChannel {
   }
 
   public boolean consume(TokenQueue tokenQueue, List<Statement> output) {
-    List<Token> matchedTokenList = new ArrayList<Token>();
+    List<Token> matchedTokenList = new ArrayList<>();
     for (TokenMatcher tokenMatcher : tokenMatchers) {
       if (!tokenMatcher.matchToken(tokenQueue, matchedTokenList)) {
         tokenQueue.pushForward(matchedTokenList);
index 5223dbc96edab1eec23f68c97a0d3cd183397707..3631d3e722b65c78efba8b22383e8c2155b2d7e8 100644 (file)
@@ -42,7 +42,7 @@ public final class StatementChunker {
     if (tokenQueue == null) {
       throw new IllegalArgumentException();
     }
-    List<Statement> statements = new ArrayList<Statement>();
+    List<Statement> statements = new ArrayList<>();
     try {
       channelDispatcher.consume(tokenQueue, statements);
       return statements;
@@ -58,7 +58,7 @@ public final class StatementChunker {
    */
   public static final class Builder {
 
-    private List<StatementChannel> channels = new ArrayList<StatementChannel>();
+    private List<StatementChannel> channels = new ArrayList<>();
 
     private Builder() {
     }
index 1b0220009afec5b8a69a3fe0c9366d56ff62bc07..5e2928a1d618032b1e150a4ec86ae146a7a6acb8 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.duplications.token.TokenQueue;
  */
 public class UptoTokenMatcher extends TokenMatcher {
 
-  private final Set<String> uptoMatchTokens = new HashSet<String>();
+  private final Set<String> uptoMatchTokens = new HashSet<>();
 
   public UptoTokenMatcher(String[] uptoMatchTokens) {
     if (uptoMatchTokens == null) {
index 433238f3db4e1de51db601858c1bf96c13b300cd..a6894bb46b910a8f97cbdaf0c8182df9f94df005 100644 (file)
@@ -30,11 +30,11 @@ public class TokenQueue implements Iterable<Token> {
   private final Deque<Token> tokenQueue;
 
   public TokenQueue(List<Token> tokenList) {
-    tokenQueue = new LinkedList<Token>(tokenList);
+    tokenQueue = new LinkedList<>(tokenList);
   }
 
   public TokenQueue() {
-    tokenQueue = new LinkedList<Token>();
+    tokenQueue = new LinkedList<>();
   }
 
   /**
index b30747121465cc546dd7fbe385550cd1eef8d189..346c5fba01c58c06225a826a636e671919ec1c71 100644 (file)
@@ -38,7 +38,7 @@ public class StringSuffixTree {
   private StringSuffixTree(String text) {
     suffixTree = SuffixTree.create(new StringText(text));
 
-    Queue<Node> queue = new LinkedList<Node>();
+    Queue<Node> queue = new LinkedList<>();
     queue.add(suffixTree.getRootNode());
     while (!queue.isEmpty()) {
       Node node = queue.remove();
index 5561f117dced797576c37c164b035c8238c14e77..9495eeace8cd6bc45de3c507ad6da7dbf6217e5f 100644 (file)
@@ -34,7 +34,7 @@ public class TokenQueueTest {
 
   @Before
   public void initTest() {
-    List<Token> tokenList = new ArrayList<Token>();
+    List<Token> tokenList = new ArrayList<>();
     tokenList.add(new Token("a", 1, 0));
     tokenList.add(new Token("bc", 1, 2));
     tokenList.add(new Token("def", 1, 5));
@@ -58,7 +58,7 @@ public class TokenQueueTest {
   @Test
   public void shouldPushTokenAtBegining() {
     Token pushedToken = new Token("push", 1, 0);
-    List<Token> pushedTokenList = new ArrayList<Token>();
+    List<Token> pushedTokenList = new ArrayList<>();
     pushedTokenList.add(pushedToken);
     tokenQueue.pushForward(pushedTokenList);
     assertThat(tokenQueue.peek(), is(pushedToken));
index 29402fcc9784aa83191919632ce1aa5d7ebf21d3..49a9b4c9f6053aaeea8c2799e66d441839cc1ec2 100644 (file)
@@ -30,7 +30,7 @@ public class CycleDetector<V> {
   private Set<V> vertices;
   private DirectedGraphAccessor<V, ? extends Edge> graph;
   private Set<V> analyzedVertices;
-  private Set<Cycle> cycles = new LinkedHashSet<Cycle>();
+  private Set<Cycle> cycles = new LinkedHashSet<>();
   private Set<Edge> edgesToExclude;
   private long searchCyclesCalls = 0;
   private int maxSearchDepth = -1;
@@ -55,8 +55,8 @@ public class CycleDetector<V> {
 
   private void init(DirectedGraphAccessor<V, ? extends Edge> graph, Collection<V> vertices, Set<Edge> edgesToExclude) {
     this.graph = graph;
-    this.vertices = new LinkedHashSet<V>(vertices);
-    this.analyzedVertices = new LinkedHashSet<V>();
+    this.vertices = new LinkedHashSet<>(vertices);
+    this.analyzedVertices = new LinkedHashSet<>();
     this.edgesToExclude = edgesToExclude;
   }
 
@@ -87,7 +87,7 @@ public class CycleDetector<V> {
     try {
       for (V vertex : vertices) {
         if (maxSearchDepthActivated || !analyzedVertices.contains(vertex)) {
-          Set<V> tmpAnalyzedVertices = new LinkedHashSet<V>();
+          Set<V> tmpAnalyzedVertices = new LinkedHashSet<>();
           searchCycles(vertex, new ArrayList<V>(), tmpAnalyzedVertices);
           analyzedVertices.addAll(tmpAnalyzedVertices);
         }
@@ -124,7 +124,7 @@ public class CycleDetector<V> {
   }
 
   private Cycle convertListOfVerticesToCycle(List<V> vertices) {
-    List<Edge> edges = new ArrayList<Edge>();
+    List<Edge> edges = new ArrayList<>();
     V firstVertex = vertices.get(0);
     V from = firstVertex;
     for (int index = 1; index < vertices.size(); index++) {
index c0d63887b8931fd746c917215ec0c7bcb2d93cb4..9dab7d83b5f8cc0d799fb6ec77de3462527b87fd 100644 (file)
@@ -30,9 +30,9 @@ import java.util.Set;
 public class DirectedGraph<V, E extends Edge<V>> implements DirectedGraphAccessor<V, E> {
 
   private EdgeFactory<V, E> edgeFactory;
-  private Map<V, Map<V, E>> outgoingEdgesByVertex = new HashMap<V, Map<V, E>>();
-  private Map<V, Map<V, E>> incomingEdgesByVertex = new HashMap<V, Map<V, E>>();
-  private Set<V> vertices = new LinkedHashSet<V>();
+  private Map<V, Map<V, E>> outgoingEdgesByVertex = new HashMap<>();
+  private Map<V, Map<V, E>> incomingEdgesByVertex = new HashMap<>();
+  private Set<V> vertices = new LinkedHashSet<>();
 
   public DirectedGraph() {
   }
@@ -42,7 +42,7 @@ public class DirectedGraph<V, E extends Edge<V>> implements DirectedGraphAccesso
   }
 
   public static DirectedGraph<String, StringEdge> createStringDirectedGraph() {
-    return new DirectedGraph<String, StringEdge>(new StringEdgeFactory());
+    return new DirectedGraph<>(new StringEdgeFactory());
   }
 
   public DirectedGraph<V, E> addEdge(V from, V to) {
@@ -75,7 +75,7 @@ public class DirectedGraph<V, E extends Edge<V>> implements DirectedGraphAccesso
   private void addEdgeToMap(V vertexKey1, V vertexKey2, E edge, Map<V, Map<V, E>> edgesByVertex) {
     Map<V, E> edges = edgesByVertex.get(vertexKey1);
     if (edges == null) {
-      edges = new HashMap<V, E>();
+      edges = new HashMap<>();
       edgesByVertex.put(vertexKey1, edges);
     }
     if (edges.containsKey(vertexKey2)) {
@@ -119,7 +119,7 @@ public class DirectedGraph<V, E extends Edge<V>> implements DirectedGraphAccesso
   }
 
   public List<E> getEdges(Collection<V> vertices) {
-    List<E> result = new ArrayList<E>();
+    List<E> result = new ArrayList<>();
     for (V vertice : vertices) {
       Collection<E> outgoingEdges = getOutgoingEdges(vertice);
       if (outgoingEdges != null) {
@@ -133,7 +133,7 @@ public class DirectedGraph<V, E extends Edge<V>> implements DirectedGraphAccesso
   public Collection<E> getOutgoingEdges(V from) {
     Map<V, E> outgoingEdges = outgoingEdgesByVertex.get(from);
     if (outgoingEdges == null) {
-      return new LinkedHashSet<E>();
+      return new LinkedHashSet<>();
     }
     return outgoingEdges.values();
   }
@@ -142,7 +142,7 @@ public class DirectedGraph<V, E extends Edge<V>> implements DirectedGraphAccesso
   public Collection<E> getIncomingEdges(V to) {
     Map<V, E> incomingEdges = incomingEdgesByVertex.get(to);
     if (incomingEdges == null) {
-      return new LinkedHashSet<E>();
+      return new LinkedHashSet<>();
     }
     return incomingEdges.values();
   }
index de81d15096b3d1bda24f0156ef7ccd9547956b49..685dfbe348e3d5e4f45311655a0866df76abf14c 100644 (file)
@@ -34,7 +34,7 @@ public final class DsmManualSorter<V> {
   }
 
   public static <V> void sort(Dsm<V> dsm, List<V> vertices) {
-    DsmManualSorter<V> sorter = new DsmManualSorter<V>(dsm, vertices);
+    DsmManualSorter<V> sorter = new DsmManualSorter<>(dsm, vertices);
     sorter.sort();
   }
 
index beb5318f74b8e66ae5c029d0b5770071f03c9c3a..268edcc1b842834f9eb43c5aa4f72f4a638585ca 100644 (file)
@@ -36,7 +36,7 @@ public final class DsmScanner {
   private static final char FEEDBACK_EDGE_FLAG = '*';
   private final DirectedGraph<String, StringEdge> graph = DirectedGraph.createStringDirectedGraph();
   private String[] vertices;
-  private Set<Edge> feedbackEdges = new LinkedHashSet<Edge>();
+  private Set<Edge> feedbackEdges = new LinkedHashSet<>();
 
   private DsmScanner(Reader reader) {
     this.reader = new LineNumberReader(reader);
@@ -51,7 +51,7 @@ public final class DsmScanner {
     } catch (IOException e) {
       throw new RuntimeException("Unable to read DSM content.", e); // NOSONAR
     }
-    Dsm<String> dsm = new Dsm<String>(graph, graph.getVertices(), feedbackEdges);
+    Dsm<String> dsm = new Dsm<>(graph, graph.getVertices(), feedbackEdges);
     DsmManualSorter.sort(dsm, Arrays.asList(vertices));
     return dsm;
   }
index e910a8b4128b00caf902312c0cc77eca71317c9f..a55ec749fd853bf3e6dbcc14a94de853f2f00936 100644 (file)
@@ -32,7 +32,7 @@ public final class DsmTopologicalSorter<V> {
   }
 
   public static <V> void sort(Dsm<V> dsm) {
-    DsmTopologicalSorter<V> partitionner = new DsmTopologicalSorter<V>(dsm);
+    DsmTopologicalSorter<V> partitionner = new DsmTopologicalSorter<>(dsm);
     boolean dsmCanBeSorted = true;
     while (dsmCanBeSorted) {
       boolean dsmCanBeSortedOnLeft = partitionner.pushToLeftVerticesWithoutIncomingEdges();
index 7a22fcd0c0da6f32de87edec2e8f025f8dbed437..30822911df295dffb6ff54a087cff5619374cedf 100644 (file)
@@ -39,7 +39,7 @@ public final class FeedbackCycle implements Iterable<FeedbackEdge>, Comparable<F
   private final Cycle cycle;
 
   private FeedbackCycle(Cycle cycle) {
-    orderedFeedbackEdges = new ArrayList<FeedbackEdge>();
+    orderedFeedbackEdges = new ArrayList<>();
     totalOccurrencesOfEdgesInCycle = 0;
     this.cycle = cycle;
   }
@@ -51,7 +51,7 @@ public final class FeedbackCycle implements Iterable<FeedbackEdge>, Comparable<F
   public static List<FeedbackCycle> buildFeedbackCycles(Set<Cycle> cycles) {
     Multiset<Edge> edgesBag = createBagWithAllEdgesOfCycles(cycles);
 
-    List<FeedbackCycle> feedbackCycles = new ArrayList<FeedbackCycle>();
+    List<FeedbackCycle> feedbackCycles = new ArrayList<>();
     for (Cycle cycle : cycles) {
       FeedbackCycle feedbackCycle = new FeedbackCycle(cycle);
       int totalOccurrences = 0;
index cd814c615f41edb41c1651ece672316a7a2afbcd..4e8bda55c7750fbc19d2e094021ece1d82924835 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Set;
 
 public class IncrementalCyclesAndFESSolver<V> {
 
-  private Set<Cycle> cycles = new LinkedHashSet<Cycle>();
+  private Set<Cycle> cycles = new LinkedHashSet<>();
   private long searchCyclesCalls = 0;
   private static final int DEFAULT_MAX_SEARCH_DEPTH_AT_FIRST = 3;
   private static final int DEFAULT_MAX_CYCLES_TO_FOUND_BY_ITERATION = 100;
@@ -40,7 +40,7 @@ public class IncrementalCyclesAndFESSolver<V> {
     int maxCyclesToFoundByIteration) {
 
     iterations++;
-    CycleDetector<V> cycleDetector = new CycleDetector<V>(graph, vertices);
+    CycleDetector<V> cycleDetector = new CycleDetector<>(graph, vertices);
     cycleDetector.detectCyclesWithMaxSearchDepth(maxSearchDepthAtFirst);
     searchCyclesCalls += cycleDetector.getSearchCyclesCalls();
     cycles.addAll(cycleDetector.getCycles());
@@ -49,7 +49,7 @@ public class IncrementalCyclesAndFESSolver<V> {
 
     do {
       iterations++;
-      cycleDetector = new CycleDetector<V>(graph, vertices, edgesToExclude);
+      cycleDetector = new CycleDetector<>(graph, vertices, edgesToExclude);
       cycleDetector.detectCyclesWithUpperLimit(maxCyclesToFoundByIteration);
       searchCyclesCalls += cycleDetector.getSearchCyclesCalls();
       cycles.addAll(cycleDetector.getCycles());
index aaebdced22c16e34cddb5c23949ae64f1244e4c7..6f9ec3b1ce1f22fe7e3613f6e1dc84150c359b49 100644 (file)
@@ -64,7 +64,7 @@ public class MinimumFeedbackEdgeSetSolver {
    * Get edges tagged as feedback.
    */
   public Set<Edge> getEdges() {
-    Set<Edge> edges = new LinkedHashSet<Edge>();
+    Set<Edge> edges = new LinkedHashSet<>();
     for (FeedbackEdge fe : feedbackEdges) {
       edges.add(fe.getEdge());
     }
@@ -72,7 +72,7 @@ public class MinimumFeedbackEdgeSetSolver {
   }
 
   private void run() {
-    Set<FeedbackEdge> pendingFeedbackEdges = new LinkedHashSet<FeedbackEdge>();
+    Set<FeedbackEdge> pendingFeedbackEdges = new LinkedHashSet<>();
     if (cyclesNumber < maxNumberCyclesForSearchingMinimumFeedback) {
       searchFeedbackEdges(0, 0, pendingFeedbackEdges);
     } else {
@@ -81,7 +81,7 @@ public class MinimumFeedbackEdgeSetSolver {
   }
 
   private void lightResearchForFeedbackEdges() {
-    feedbackEdges = new LinkedHashSet<FeedbackEdge>();
+    feedbackEdges = new LinkedHashSet<>();
     for (FeedbackCycle cycle : feedbackCycles) {
       for (FeedbackEdge edge : cycle) {
         feedbackEdges.add(edge);
@@ -105,7 +105,7 @@ public class MinimumFeedbackEdgeSetSolver {
 
     if (level == cyclesNumber) {
       minimumFeedbackEdgesWeight = pendingWeight;
-      feedbackEdges = new LinkedHashSet<FeedbackEdge>(pendingFeedbackEdges);
+      feedbackEdges = new LinkedHashSet<>(pendingFeedbackEdges);
       return;
     }
 
index 486f6dd20c857533e24f8db813b16b0c358e754c..244ae9f6adae33a3a4c95218a9907e3f36755c14 100644 (file)
@@ -36,7 +36,7 @@ public class CycleDetectorTest {
     dag.addEdge("B", "D");
     dag.addEdge("A", "D");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dag);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dag);
     cycleDetector.detectCycles();
     assertThat(cycleDetector.isAcyclicGraph()).isTrue();
   }
@@ -46,7 +46,7 @@ public class CycleDetectorTest {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B").addEdge("B", "C").addEdge("C", "A");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
     assertThat(cycleDetector.isAcyclicGraph()).isFalse();
   }
@@ -62,7 +62,7 @@ public class CycleDetectorTest {
     dcg.addEdge("E", "F");
     dcg.addEdge("F", "C");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
     assertThat(cycleDetector.getCycles()).hasSize(8);
     assertThat(cycleDetector.getSearchCyclesCalls()).isEqualTo(11);
@@ -75,11 +75,11 @@ public class CycleDetectorTest {
     dcg.addEdge("C", "A");
     dcg.addEdge("B", "A");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCyclesWithMaxSearchDepth(3);
     assertThat(cycleDetector.getCycles()).hasSize(2);
 
-    cycleDetector = new CycleDetector<String>(dcg);
+    cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCyclesWithMaxSearchDepth(2);
     assertThat(cycleDetector.getCycles()).hasSize(1);
   }
@@ -91,11 +91,11 @@ public class CycleDetectorTest {
     dcg.addEdge("C", "A");
     dcg.addEdge("B", "A");
 
-    Set<Edge> excludedEdges = new HashSet<Edge>();
+    Set<Edge> excludedEdges = new HashSet<>();
     excludedEdges.add(dcg.getEdge("C", "A"));
     excludedEdges.add(dcg.getEdge("B", "A"));
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg, excludedEdges);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg, excludedEdges);
     cycleDetector.detectCycles();
     assertThat(cycleDetector.getCycles()).hasSize(1);
   }
@@ -106,7 +106,7 @@ public class CycleDetectorTest {
     dcg.addEdge("A", "B").addEdge("B", "C").addEdge("C", "D").addEdge("D", "E");
     dcg.addEdge("B", "A");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
     assertThat(cycleDetector.getCycles()).hasSize(1);
     Cycle cycle = cycleDetector.getCycles().iterator().next();
@@ -121,12 +121,12 @@ public class CycleDetectorTest {
     dcg.addEdge("A", "B").addEdge("B", "C").addEdge("C", "A");
 
     // C must not be used to find cycles
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg, Arrays.asList("A", "B"));
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg, Arrays.asList("A", "B"));
     cycleDetector.detectCycles();
     assertThat(cycleDetector.getCycles()).isEmpty();
 
     // C is used to find cycles
-    cycleDetector = new CycleDetector<String>(dcg, Arrays.asList("A", "B", "C"));
+    cycleDetector = new CycleDetector<>(dcg, Arrays.asList("A", "B", "C"));
     cycleDetector.detectCycles();
     assertThat(cycleDetector.getCycles().size()).isEqualTo(1);
   }
@@ -136,7 +136,7 @@ public class CycleDetectorTest {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B").addEdge("B", "C").addEdge("C", "A");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
     cycleDetector.detectCycles();
   }
@@ -147,7 +147,7 @@ public class CycleDetectorTest {
     dcg.addEdge("A", "B").addEdge("B", "C").addEdge("C", "D").addEdge("D", "A");
     dcg.addEdge("B", "A");
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     assertThat(cycleDetector.detectCyclesWithUpperLimit(1)).hasSize(1);
   }
 }
index 7ee4468915c933f0d26aff3ab7b80dad71af6c94..7735dd510c538757a7082fda2164aec4b7493f9c 100644 (file)
@@ -31,7 +31,7 @@ public class DsmManualSorterTest {
     graph.addEdge("A", "B", 2);
     graph.addEdge("A", "C", 3);
     graph.addEdge("C", "B", 1);
-    Dsm<String> dsm = new Dsm<String>(graph);
+    Dsm<String> dsm = new Dsm<>(graph);
     DsmManualSorter.sort(dsm, "B", "A", "C");
 
     StringPrintWriter expectedDsm = new StringPrintWriter();
index 27bd1b36a1a52da9a509905e32bc89a3884743ab..063e1955b89c5ad815254db44191a678e6704fda 100644 (file)
@@ -37,7 +37,7 @@ public class DsmPrinterTest {
     graph.addEdge("A", "B", 3).addEdge("A", "C", 2);
     graph.addEdge("C", "B", 4).addEdge("C", "A", 1);
     HashSet<Edge> feedbackEdges = Sets.<Edge>newHashSet(graph.getEdge("C", "A"));
-    dsm = new Dsm<String>(graph, feedbackEdges);
+    dsm = new Dsm<>(graph, feedbackEdges);
     DsmManualSorter.sort(dsm, "A", "C", "B");
   }
 
index 494129a62d977fbb55fe72384ced63532d9aa63c..9a22ea4555b94155ace041fa865e6ce2c1cb20d8 100644 (file)
@@ -91,12 +91,12 @@ public class DsmTopologicalSorterTest {
   public void sortCyclicGraphWithFlaggedFeedbackEdges() {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B", 3).addEdge("B", "A", 1);
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycleDetector.getCycles());
 
-    Dsm<String> dsm = new Dsm<String>(dcg, solver.getEdges());
+    Dsm<String> dsm = new Dsm<>(dcg, solver.getEdges());
     DsmTopologicalSorter.sort(dsm);
 
     StringPrintWriter expectedDsm = new StringPrintWriter();
index 604bf78a5a7cfd19ec7c596f4b759a4d568f54af..e14a97e691a233500a5e97c2dc68606c9e4b26d5 100644 (file)
@@ -46,7 +46,7 @@ public class FeedbackCycleTest {
 
   @Test
   public void testBuildFeedbackCycles() {
-    Set<Cycle> cycles = new HashSet<Cycle>();
+    Set<Cycle> cycles = new HashSet<>();
     cycles.add(AB_Cycle);
     cycles.add(ABC_Cycle);
     cycles.add(BCDA_Cycle);
index 40f18b2176b48a02eeb285fd1e1338323fd74b24..104c11044a9322b2940b67d85b1bb455110e2908 100644 (file)
@@ -37,7 +37,7 @@ public class IncrementalCyclesAndFESSolverTest {
     dcg.addEdge("E", "F");
     dcg.addEdge("F", "C");
 
-    IncrementalCyclesAndFESSolver<String> cyclesAndFESSolver = new IncrementalCyclesAndFESSolver<String>(dcg, dcg.getVertices(), 3,
+    IncrementalCyclesAndFESSolver<String> cyclesAndFESSolver = new IncrementalCyclesAndFESSolver<>(dcg, dcg.getVertices(), 3,
         Integer.MAX_VALUE);
     assertThat(cyclesAndFESSolver.getCycles().size(), is(4));
     assertThat(cyclesAndFESSolver.getFeedbackEdgeSet().size(), is(2));
@@ -49,7 +49,7 @@ public class IncrementalCyclesAndFESSolverTest {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B").addEdge("B", "C").addEdge("C", "D").addEdge("D", "A");
 
-    IncrementalCyclesAndFESSolver<String> cyclesAndFESSolver = new IncrementalCyclesAndFESSolver<String>(dcg, dcg.getVertices(), 2,
+    IncrementalCyclesAndFESSolver<String> cyclesAndFESSolver = new IncrementalCyclesAndFESSolver<>(dcg, dcg.getVertices(), 2,
         Integer.MAX_VALUE);
     assertThat(cyclesAndFESSolver.getCycles().size(), is(1));
     assertThat(cyclesAndFESSolver.getFeedbackEdgeSet().size(), is(1));
@@ -63,7 +63,7 @@ public class IncrementalCyclesAndFESSolverTest {
     dcg.addEdge("E", "F").addEdge("F", "G").addEdge("G", "E");
     dcg.addEdge("H", "I").addEdge("I", "H");
 
-    IncrementalCyclesAndFESSolver<String> cyclesAndFESSolver = new IncrementalCyclesAndFESSolver<String>(dcg, dcg.getVertices(), 2, 1);
+    IncrementalCyclesAndFESSolver<String> cyclesAndFESSolver = new IncrementalCyclesAndFESSolver<>(dcg, dcg.getVertices(), 2, 1);
     assertThat(cyclesAndFESSolver.getCycles().size(), is(3));
     assertThat(cyclesAndFESSolver.getIterations(), is(4));
     cyclesAndFESSolver.getFeedbackEdgeSet();
index 09c0e66c9e9841b4cf9e9a99615b268bfbb24c27..580cc64f37fc2dc6d8af8b9fa9e5523b9afb8368 100644 (file)
@@ -33,7 +33,7 @@ public class MinimumFeedbackEdgeSetSolverTest {
   public void testGetFeedbackEdgesOnSimpleLoop() {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B", 3).addEdge("B", "A", 1);
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycleDetector.getCycles());
@@ -45,7 +45,7 @@ public class MinimumFeedbackEdgeSetSolverTest {
   public void testFlagFeedbackEdgesOnSimpleLoop() {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B", 3).addEdge("B", "A", 1);
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycleDetector.getCycles());
@@ -58,7 +58,7 @@ public class MinimumFeedbackEdgeSetSolverTest {
     DirectedGraph<String, StringEdge> dcg = DirectedGraph.createStringDirectedGraph();
     dcg.addEdge("A", "B", 7).addEdge("B", "C", 3).addEdge("C", "D", 1).addEdge("D", "A", 3);
     dcg.addEdge("B", "A", 12);
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycleDetector.getCycles());
@@ -75,7 +75,7 @@ public class MinimumFeedbackEdgeSetSolverTest {
     dcg.addEdge("D", "E", 3).addEdge("E", "D", 5);
     dcg.addEdge("F", "G", 1).addEdge("G", "H", 4).addEdge("H", "F", 7);
 
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
 
     MinimumFeedbackEdgeSetSolver solver = new MinimumFeedbackEdgeSetSolver(cycleDetector.getCycles());
@@ -94,7 +94,7 @@ public class MinimumFeedbackEdgeSetSolverTest {
     dcg.addEdge("A", "B", 5).addEdge("B", "C", 9).addEdge("C", "A", 1);
     dcg.addEdge("D", "B", 5).addEdge("C", "D", 7);
     dcg.addEdge("F", "B", 5).addEdge("C", "F", 4);
-    CycleDetector<String> cycleDetector = new CycleDetector<String>(dcg);
+    CycleDetector<String> cycleDetector = new CycleDetector<>(dcg);
     cycleDetector.detectCycles();
 
     MinimumFeedbackEdgeSetSolver minimumSolver = new MinimumFeedbackEdgeSetSolver(cycleDetector.getCycles());
index 9f123486313b8681d96037e1414929049c1a0a58..755eecc1d709b71e7282f16adfee2380731f2552 100644 (file)
@@ -77,7 +77,7 @@ public class ProjectDefinition {
   private static final char SEPARATOR = ',';
 
   private File baseDir, workDir, buildDir;
-  private Map<String, String> properties = new HashMap<String, String>();
+  private Map<String, String> properties = new HashMap<>();
   private ProjectDefinition parent = null;
   private List<ProjectDefinition> subProjects = new ArrayList<>();
   private List<Object> containerExtensions = new ArrayList<>();
index 7d3d34f764211ce052cd9f02bd639d788bcade41..164febb90948c264324502f89981ec325267d4dd 100644 (file)
@@ -129,7 +129,7 @@ public class DefaultFilePredicates implements FilePredicates {
 
   @Override
   public FilePredicate hasLanguages(Collection<String> languages) {
-    List<FilePredicate> list = new ArrayList<FilePredicate>();
+    List<FilePredicate> list = new ArrayList<>();
     for (String language : languages) {
       list.add(hasLanguage(language));
     }
@@ -138,7 +138,7 @@ public class DefaultFilePredicates implements FilePredicates {
 
   @Override
   public FilePredicate hasLanguages(String... languages) {
-    List<FilePredicate> list = new ArrayList<FilePredicate>();
+    List<FilePredicate> list = new ArrayList<>();
     for (String language : languages) {
       list.add(hasLanguage(language));
     }
index 719dd2f8aaca7c684ea38df0bd62e6b5382244c5..2876fdfa9bab142950b2aa48ed041cae21d26bdd 100644 (file)
@@ -50,7 +50,7 @@ import java.util.TreeSet;
 public class DefaultFileSystem implements FileSystem {
 
   private final Cache cache;
-  private final SortedSet<String> languages = new TreeSet<String>();
+  private final SortedSet<String> languages = new TreeSet<>();
   private final Path baseDir;
   private Path workDir;
   private Charset encoding;
@@ -256,12 +256,12 @@ public class DefaultFileSystem implements FileSystem {
    * Used only for testing
    */
   private static class MapCache extends Cache {
-    private final Map<String, InputFile> fileMap = new HashMap<String, InputFile>();
-    private final Map<String, InputDir> dirMap = new HashMap<String, InputDir>();
+    private final Map<String, InputFile> fileMap = new HashMap<>();
+    private final Map<String, InputDir> dirMap = new HashMap<>();
 
     @Override
     public Iterable<InputFile> inputFiles() {
-      return new ArrayList<InputFile>(fileMap.values());
+      return new ArrayList<>(fileMap.values());
     }
 
     @Override
index 0862cfca9e8bd717020f633842ee5bd2e9937c23..19b101720a4ce8e30fa4bcf92580d859ff90550b 100644 (file)
@@ -191,7 +191,7 @@ public class FileMetadata {
 
   private static class LineOffsetCounter extends CharHandler {
     private int currentOriginalOffset = 0;
-    private List<Integer> originalLineOffsets = new ArrayList<Integer>();
+    private List<Integer> originalLineOffsets = new ArrayList<>();
     private int lastValidOffset = 0;
 
     public LineOffsetCounter() {
index 93fca9998447685151fa798267574c9dba1a81af..924832e2d6afe91ceb624951ac6b194d85ed8f78 100644 (file)
@@ -37,6 +37,6 @@ public class CheckFactory {
   }
 
   public <C> Checks<C> create(String repository) {
-    return new Checks<C>(activeRules, repository);
+    return new Checks<>(activeRules, repository);
   }
 }
index 91b5cafda55f99b2f119826eb51116b14c099207..2104b3d4e50139ddab2e97116e4bb623639e080f 100644 (file)
@@ -36,8 +36,8 @@ public class DefaultActiveRules implements ActiveRules {
 
   // TODO use disk-backed cache (persistit) instead of full in-memory cache ?
   private final ListMultimap<String, ActiveRule> activeRulesByRepository;
-  private final Map<String, Map<String, ActiveRule>> activeRulesByRepositoryAndKey = new HashMap<String, Map<String, ActiveRule>>();
-  private final Map<String, Map<String, ActiveRule>> activeRulesByRepositoryAndInternalKey = new HashMap<String, Map<String, ActiveRule>>();
+  private final Map<String, Map<String, ActiveRule>> activeRulesByRepositoryAndKey = new HashMap<>();
+  private final Map<String, Map<String, ActiveRule>> activeRulesByRepositoryAndInternalKey = new HashMap<>();
   private final ListMultimap<String, ActiveRule> activeRulesByLanguage;
 
   public DefaultActiveRules(Collection<NewActiveRule> newActiveRules) {
index 07e85dc9a76e51155fcb26af2e9496aacd2d5c23..db91ca70fe4afe8c5db1626cf6f2e0c32f06d9bf 100644 (file)
@@ -35,7 +35,7 @@ public class NewActiveRule {
   final RuleKey ruleKey;
   String name;
   String severity = Severity.defaultSeverity();
-  Map<String, String> params = new HashMap<String, String>();
+  Map<String, String> params = new HashMap<>();
   String internalKey, language, templateRuleKey;
   private final ActiveRulesBuilder builder;
 
index 213236247d21d56caa74a1f219f3af08d760e3ff..593f859c6953551c44346b2f8fac42e77297ee18 100644 (file)
@@ -40,7 +40,7 @@ public class NewRule {
   String name, description, severity = DEFAULT_SEVERITY, internalKey, debtSubCharacteristic;
   DebtRemediationFunction debtRemediationFunction;
   RuleStatus status = RuleStatus.defaultStatus();
-  Map<String, NewRuleParam> params = new HashMap<String, NewRuleParam>();
+  Map<String, NewRuleParam> params = new HashMap<>();
 
   NewRule(RuleKey key) {
     this.key = key;
index e43f864a2918d2b7043a5b8880720523606e5d97..c46cb987e9ffb937a70dce9d5a3d1afc9b41f61d 100644 (file)
@@ -33,7 +33,7 @@ import java.util.Map;
 
 public class RulesBuilder {
 
-  private final Map<RuleKey, NewRule> map = new HashMap<RuleKey, NewRule>();
+  private final Map<RuleKey, NewRule> map = new HashMap<>();
 
   public NewRule add(RuleKey key) {
     if (map.containsKey(key)) {
index d9836036646565a48bfab56d876db333ef983b40..6c00e8ba33addd455c439f051737c6bb3ce81344 100644 (file)
@@ -40,7 +40,7 @@ import java.util.List;
 public class DefaultDuplication extends DefaultStorable implements NewDuplication, Duplication {
 
   private Block originBlock;
-  private List<Block> duplicates = new LinkedList<Duplication.Block>();
+  private List<Block> duplicates = new LinkedList<>();
 
   public DefaultDuplication() {
     super();
index 70f80865045a12543663e54acaaac3f00ac796d8..13027e244263288d7b769f5b7c292be437316199 100644 (file)
@@ -224,7 +224,7 @@ public class SensorContextTester implements SensorContext {
     if (syntaxHighlightingData == null) {
       return Collections.emptyList();
     }
-    List<TypeOfText> result = new ArrayList<TypeOfText>();
+    List<TypeOfText> result = new ArrayList<>();
     DefaultTextPointer location = new DefaultTextPointer(line, lineOffset);
     for (SyntaxHighlightingRule sortedRule : syntaxHighlightingData.getSyntaxHighlightingRuleSet()) {
       if (sortedRule.range().start().compareTo(location) <= 0 && sortedRule.range().end().compareTo(location) > 0) {
index 4907cda46092472eb25ac5b7edb406b11388d8f4..b07a0d400eb95bd0a69e73be9ab9111cdf00f2b7 100644 (file)
@@ -135,18 +135,18 @@ public final class PropertyDefinitions {
    * @since 3.7
    */
   public Map<Category, Map<SubCategory, Collection<PropertyDefinition>>> propertiesByCategory(@Nullable String qualifier) {
-    Map<Category, Map<SubCategory, Collection<PropertyDefinition>>> byCategory = new HashMap<Category, Map<SubCategory, Collection<PropertyDefinition>>>();
+    Map<Category, Map<SubCategory, Collection<PropertyDefinition>>> byCategory = new HashMap<>();
     if (qualifier == null) {
       // Special categories on global page
-      Map<SubCategory, Collection<PropertyDefinition>> emailSubCategories = new HashMap<SubCategory, Collection<PropertyDefinition>>();
+      Map<SubCategory, Collection<PropertyDefinition>> emailSubCategories = new HashMap<>();
       emailSubCategories.put(new SubCategory("email", true), new ArrayList<PropertyDefinition>());
       byCategory.put(new Category(CoreProperties.CATEGORY_GENERAL, false), emailSubCategories);
 
-      HashMap<SubCategory, Collection<PropertyDefinition>> licenseSubCategories = new HashMap<SubCategory, Collection<PropertyDefinition>>();
+      HashMap<SubCategory, Collection<PropertyDefinition>> licenseSubCategories = new HashMap<>();
       licenseSubCategories.put(new SubCategory("server_id", true), new ArrayList<PropertyDefinition>());
       byCategory.put(new Category(CoreProperties.CATEGORY_LICENSES, false), licenseSubCategories);
 
-      HashMap<SubCategory, Collection<PropertyDefinition>> encryptionSubCategories = new HashMap<SubCategory, Collection<PropertyDefinition>>();
+      HashMap<SubCategory, Collection<PropertyDefinition>> encryptionSubCategories = new HashMap<>();
       encryptionSubCategories.put(new SubCategory("encryption", true), new ArrayList<PropertyDefinition>());
       byCategory.put(new Category(CoreProperties.CATEGORY_SECURITY, false), encryptionSubCategories);
     }
index ef79ca10051ebbda4cde7f3bbb4faa4bb515c4bb..42530abf1320df5fe7e275aa896be2b0db786424 100644 (file)
@@ -40,7 +40,7 @@ public final class MeasuresFilters {
     return new MeasuresFilter<Collection<Measure>>() {
       @Override
       public Collection<Measure> filter(Collection<Measure> measures) {
-        Collection<Measure> all = new ArrayList<Measure>();
+        Collection<Measure> all = new ArrayList<>();
         for (Measure measure : measures) {
           if (measure != null) {
             all.add(measure);
@@ -174,7 +174,7 @@ public final class MeasuresFilters {
         if (measures == null) {
           return null;
         }
-        List<RuleMeasure> result = new ArrayList<RuleMeasure>();
+        List<RuleMeasure> result = new ArrayList<>();
         for (Measure measure : measures) {
           if (apply(measure)) {
             result.add((RuleMeasure) measure);
index e53c1471b44bb0dfd0c6e8a57f48da9e986f0092..574c3d87ea0ab91483583483bc12ee5f4bf513b1 100644 (file)
@@ -801,7 +801,7 @@ public class Metric<G extends Serializable> implements Serializable, org.sonar.a
         this.bestValue = (direction == DIRECTION_BETTER ? 100.0 : 0.0);
         this.worstValue = (direction == DIRECTION_BETTER ? 0.0 : 100.0);
       }
-      return new Metric<G>(this);
+      return new Metric<>(this);
     }
   }
 
index 3bef4b9e0c21e8d36f5ce2b1491eb4e3a393e75a..8f498befcca7bdb90ec2062509135794cfd1b316 100644 (file)
@@ -32,17 +32,17 @@ public class PropertiesBuilder<K, V> {
   private Map<K, V> props;
 
   public PropertiesBuilder(Metric metric, Map<K, V> map) {
-    this.props = new TreeMap<K, V>(map);
+    this.props = new TreeMap<>(map);
     this.metric = metric;
   }
 
   public PropertiesBuilder(Metric metric) {
-    this.props = new TreeMap<K, V>();
+    this.props = new TreeMap<>();
     this.metric = metric;
   }
 
   public PropertiesBuilder() {
-    this.props = new TreeMap<K, V>();
+    this.props = new TreeMap<>();
   }
 
   public PropertiesBuilder<K, V> clear() {
index b966968e54743ed93fa64a83989a62b96215d1f2..2b4471ef5b76c8063b323c941ac945da1e480643 100644 (file)
@@ -223,7 +223,7 @@ public class RangeDistributionBuilder implements MeasureBuilder {
    */
   public Measure<String> build(boolean allowEmptyData) {
     if (isValid && (!isEmpty || allowEmptyData)) {
-      return new Measure<String>(metric, KeyValueFormat.format(countBag, -1));
+      return new Measure<>(metric, KeyValueFormat.format(countBag, -1));
     }
     return null;
   }
index 84b971dbe92835947f25af418589da75f8ee5991..6ac3287dd6ed7b7ecbbf32cf05de1ea012d57825 100644 (file)
@@ -116,7 +116,7 @@ public class XMLProfileParser {
   }
 
   private void processRules(SMInputCursor rulesCursor, RulesProfile profile, ValidationMessages messages) throws XMLStreamException {
-    Map<String, String> parameters = new HashMap<String, String>();
+    Map<String, String> parameters = new HashMap<>();
     while (rulesCursor.getNext() != null) {
       SMInputCursor ruleCursor = rulesCursor.childElementCursor();
 
index d0ae370809f5b899341298111fd6baadd76c8a50..cf9fc43b040eb12e188f3820575f120b0b9d4969 100644 (file)
@@ -68,7 +68,7 @@ public class Languages {
    * @return the list of suffix files associates to languages included in the current object
    */
   public String[] getSuffixes(String... keys) {
-    List<String> suffixes = new ArrayList<String>();
+    List<String> suffixes = new ArrayList<>();
 
     for (Map.Entry<String, Language> entry : map.entrySet()) {
       if (ArrayUtils.isEmpty(keys) || ArrayUtils.contains(keys, entry.getKey())) {
index 466902b61c9bbaab5d941511a9bfe7ccae4478f5..14549bd4433583ea01f432b2e2c94a0b2976ca08 100644 (file)
@@ -91,7 +91,7 @@ public class Project extends Resource implements Component {
 
   // modules tree
   private Project parent;
-  private List<Project> modules = new ArrayList<Project>();
+  private List<Project> modules = new ArrayList<>();
 
   public Project(String key) {
     setKey(key);
index 493267a4b9128cc6ff12217e7f4cc97ee5f54d62..d9bc510c1fab77d08c0e5b50e2e0f9c5f90e1edb 100644 (file)
@@ -40,7 +40,7 @@ public class ActiveRule implements Cloneable {
   private Rule rule;
   private RulePriority severity;
   private RulesProfile rulesProfile;
-  private List<ActiveRuleParam> activeRuleParams = new ArrayList<ActiveRuleParam>();
+  private List<ActiveRuleParam> activeRuleParams = new ArrayList<>();
   private String inheritance;
 
   /**
index 6b7f1d79e01fa72ac21081f03b573bb187a0c0f0..0014f8df527cd5f506e8b6e921a581f569e83e65 100644 (file)
@@ -136,7 +136,7 @@ public class Rule {
 
   @org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
   @OneToMany(mappedBy = "rule")
-  private List<RuleParam> params = new ArrayList<RuleParam>();
+  private List<RuleParam> params = new ArrayList<>();
 
   @Temporal(TemporalType.TIMESTAMP)
   @Column(name = "created_at", updatable = true, nullable = true)
index 910f56fe2fbe3274ff2565eac542a0c36d6a43a4..398d1681c659e0d9963cfb995c84dea5a8e7046c 100644 (file)
@@ -125,8 +125,8 @@ public class RulesDefinitionXmlLoader {
   private void processRule(RulesDefinition.NewRepository repo, SMInputCursor ruleC) throws XMLStreamException {
     String key = null, name = null, description = null, internalKey = null, severity = Severity.defaultSeverity(), status = null;
     Cardinality cardinality = Cardinality.SINGLE;
-    List<ParamStruct> params = new ArrayList<ParamStruct>();
-    List<String> tags = new ArrayList<String>();
+    List<ParamStruct> params = new ArrayList<>();
+    List<String> tags = new ArrayList<>();
 
     /* BACKWARD COMPATIBILITY WITH VERY OLD FORMAT */
     String keyAttribute = ruleC.getAttrValue("key");
index 00ba41a1d4b0b537eeb7d7193160681b8143cccf..23a904c46e666d249a1dc7fbbda05e386eebf907 100644 (file)
@@ -48,7 +48,7 @@ public class LocalizedMessages extends ResourceBundle {
    */
   public LocalizedMessages(Locale locale, String... basenames) {
     this.locale = locale;
-    bundles = new ArrayList<ResourceBundle>(basenames.length);
+    bundles = new ArrayList<>(basenames.length);
     for (String basename : basenames) {
       bundles.add(getBundle("sonar.bundles." + basename, locale));
     }
@@ -108,7 +108,7 @@ public class LocalizedMessages extends ResourceBundle {
   }
 
   private class KeyEnumeration implements Enumeration<String> {
-    private Set<String> keys = new HashSet<String>();
+    private Set<String> keys = new HashSet<>();
 
     // Set iterator to simulate enumeration
     private Iterator<String> i;
index 10f22a2523e2a3102c7c61fb4cac2b01b7e6a972..e8e13ce02d4b40b7af05fd2a93b7d1f666589426 100644 (file)
@@ -41,7 +41,7 @@ public final class ManifestUtils {
    * @return the values, an empty list if the property is not found.
    */
   public static List<String> getPropertyValues(ClassLoader classloader, String key) {
-    List<String> values = new ArrayList<String>();
+    List<String> values = new ArrayList<>();
     try {
       Enumeration<URL> resources = classloader.getResources("META-INF/MANIFEST.MF");
       while (resources.hasMoreElements()) {
index 967bcd67dbb10b72d1f8b14de6021641d66d9c8a..9b753335518f5596de55fe9411ee6538b62daae8 100644 (file)
@@ -28,9 +28,9 @@ import java.util.List;
 
 public final class ValidationMessages {
 
-  private List<String> errors = new ArrayList<String>();
-  private List<String> warnings = new ArrayList<String>();
-  private List<String> infos = new ArrayList<String>();
+  private List<String> errors = new ArrayList<>();
+  private List<String> warnings = new ArrayList<>();
+  private List<String> infos = new ArrayList<>();
 
   /**
    * Use the factory method <code>create()</code>
index 176edf7dbcae0e4416cfdfcd1d2e9c3084f74c80..9d7aa27061e3b2a0a59935fd098571f6e69ce3a0 100644 (file)
@@ -61,7 +61,7 @@ import org.apache.commons.lang.StringUtils;
  */
 public class WildcardPattern {
 
-  private static final Map<String, WildcardPattern> CACHE = new HashMap<String, WildcardPattern>();
+  private static final Map<String, WildcardPattern> CACHE = new HashMap<>();
   private static final String SPECIAL_CHARS = "()[]^$.{}+|";
 
   private Pattern pattern;
index e206847699b929a6d7a2e94f33bb1ce5aadf0e8a..ea3ef78527ab8f39739cbfe7307ecda116147470 100644 (file)
@@ -172,7 +172,7 @@ public class XpathParser {
   }
 
   public List<Element> getChildElements(String elementName) {
-    List<Element> rtrVal = new ArrayList<Element>();
+    List<Element> rtrVal = new ArrayList<>();
     NodeList childrens = getRoot().getElementsByTagName(elementName);
     for (int i = 0; i < childrens.getLength(); i++) {
       Node nde = childrens.item(i);
@@ -184,7 +184,7 @@ public class XpathParser {
   }
 
   public List<Element> getChildElements(Element base, String elementName) {
-    List<Element> rtrVal = new ArrayList<Element>();
+    List<Element> rtrVal = new ArrayList<>();
     NodeList childrens = base.getElementsByTagName(elementName);
     for (int i = 0; i < childrens.getLength(); i++) {
       Node nde = childrens.item(i);
index 76595f08550a6af2993bafcd4579db8aa913ae44..c9c7d2a598bf6692624f3248c22a1b93c4eb94d6 100644 (file)
@@ -34,8 +34,8 @@ import java.util.Map;
  */
 public class DirectAcyclicGraph {
 
-  private Map<Object, Node> registeredObjects = new HashMap<Object, Node>();
-  private List<Node> nodes = new ArrayList<Node>();
+  private Map<Object, Node> registeredObjects = new HashMap<>();
+  private List<Node> nodes = new ArrayList<>();
 
   public DirectAcyclicGraph(final Object... objects) {
     if (objects != null) {
index db391a688f0a92bbc1d1cfbe9264f87218967c5b..bb29ba99d87f3211c006cc1b136e8f463c203c3b 100644 (file)
@@ -32,7 +32,7 @@ public class Node implements Comparable<Node> {
   private final Object object;
   private int order = 0;
   private boolean seen = false;
-  private final List<Node> dependencies = new ArrayList<Node>();
+  private final List<Node> dependencies = new ArrayList<>();
 
   public Node(final Object object) {
     if (object == null) {
index d540ddb1a6105d814f7251883386a772c2ccf053..f7e89fd07f372bc02c72daed8e8e6fb9dc3fa4b6 100644 (file)
@@ -27,7 +27,7 @@ import org.junit.Test;
 public class PropertiesBuilderTest {
   @Test
   public void buildMeasure() {
-    PropertiesBuilder<Integer, Integer> builder = new PropertiesBuilder<Integer, Integer>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
+    PropertiesBuilder<Integer, Integer> builder = new PropertiesBuilder<>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
     Measure measure = builder
         .add(1, 30)
         .add(2, 27)
@@ -39,7 +39,7 @@ public class PropertiesBuilderTest {
 
   @Test
   public void sortKeys() {
-    PropertiesBuilder<String, String> builder = new PropertiesBuilder<String, String>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
+    PropertiesBuilder<String, String> builder = new PropertiesBuilder<>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
     Measure measure = builder
         .add("foo", "fooooo")
         .add("bar", "baaaaar")
@@ -51,7 +51,7 @@ public class PropertiesBuilderTest {
 
   @Test
   public void valueIsOptional() {
-    PropertiesBuilder<String, String> builder = new PropertiesBuilder<String, String>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
+    PropertiesBuilder<String, String> builder = new PropertiesBuilder<>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
     Measure measure = builder
         .add("foo", null)
         .add("bar", "bar")
@@ -63,7 +63,7 @@ public class PropertiesBuilderTest {
 
   @Test
   public void clearBeforeBuildingOtherMeasure() {
-    PropertiesBuilder<String, String> builder = new PropertiesBuilder<String, String>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
+    PropertiesBuilder<String, String> builder = new PropertiesBuilder<>(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION);
     builder
         .add("foo", "foo")
         .add("bar", "bar")
index fa36ab4986b74d875f72e760b9495288271c0c66..ddc5e56952809cc8b1b63dcc86d12b1a7739c61c 100644 (file)
@@ -56,7 +56,7 @@ public class UserQueryTest {
 
   @Test
   public void should_limit_number_of_logins() {
-    List<String> logins = new ArrayList<String>();
+    List<String> logins = new ArrayList<>();
     for (int i = 0; i < 1010; i++) {
       logins.add(String.valueOf(i));
     }