@@ -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++; |
@@ -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; | |||
@@ -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 ? |
@@ -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) { |
@@ -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) { |
@@ -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); |
@@ -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); |
@@ -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; |
@@ -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()); |
@@ -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)); | |||
} |
@@ -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]; |
@@ -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); |
@@ -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); |
@@ -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; |
@@ -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()) || |
@@ -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) { |
@@ -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); |
@@ -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()); | |||
} |
@@ -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()); |
@@ -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) { |
@@ -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() |
@@ -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()); | |||
@@ -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()); |
@@ -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); | |||
} |
@@ -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) { |
@@ -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) |
@@ -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()); |
@@ -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()) |
@@ -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)) { |
@@ -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()); |
@@ -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); |
@@ -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); | |||
} |
@@ -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())); |
@@ -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) |
@@ -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)); |
@@ -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) { |
@@ -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)); |
@@ -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 { |
@@ -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; |
@@ -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; |
@@ -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"); |
@@ -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; |
@@ -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 { |
@@ -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; |
@@ -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); |
@@ -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(); |
@@ -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( |
@@ -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) { |
@@ -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() { | |||
} |
@@ -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() { | |||
} |
@@ -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() { | |||
} |
@@ -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() { | |||
} |
@@ -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() { | |||
} |
@@ -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() { | |||
} |
@@ -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) { |
@@ -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() { |
@@ -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) { |
@@ -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)); |
@@ -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 |
@@ -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) { |
@@ -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() { |
@@ -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() { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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)); |
@@ -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) { |
@@ -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("="); |
@@ -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; |
@@ -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(); |
@@ -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); |
@@ -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) { |
@@ -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); |
@@ -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() { | |||
} |
@@ -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() { | |||
} |
@@ -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); | |||
} |
@@ -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); | |||
} |
@@ -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(), |
@@ -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(), |
@@ -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(), |
@@ -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) { |
@@ -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; |
@@ -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) { |
@@ -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; | |||
} |
@@ -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(); |
@@ -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) { |
@@ -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) { |
@@ -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); |
@@ -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) { |
@@ -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; |
@@ -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); |
@@ -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); |
@@ -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) { |
@@ -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(); | |||
} |
@@ -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) { |
@@ -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); |
@@ -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); | |||
} |
@@ -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) { |
@@ -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); |