Use Java 7+ diamond operator in compiler modules

This commit is contained in:
Alexander Udalov
2017-04-01 02:28:36 +03:00
parent 37f435da93
commit d440f07111
187 changed files with 512 additions and 533 deletions
@@ -53,7 +53,7 @@ public class GenerateKeywordStrings {
p.println("public static final Set<String> KEYWORDS = new HashSet<String>(Arrays.asList(");
p.pushIndent();
List<String> strings = new ArrayList<String>();
List<String> strings = new ArrayList<>();
for (IElementType type : KtTokens.KEYWORDS.getTypes()) {
assert type instanceof KtKeywordToken : "Not a keyword in KtTokens.KEYWORDS: " + type;
KtKeywordToken keyword = (KtKeywordToken) type;
@@ -72,7 +72,7 @@ public class SimpleTestClassModel implements TestClassModel {
this.testClassName = testClassName;
this.targetBackend = targetBackend;
this.checkFilenameStartsLowerCase = checkFilenameStartsLowerCase;
this.excludeDirs = excludeDirs.isEmpty() ? Collections.<String>emptySet() : new LinkedHashSet<String>(excludeDirs);
this.excludeDirs = excludeDirs.isEmpty() ? Collections.emptySet() : new LinkedHashSet<>(excludeDirs);
}
@NotNull
@@ -106,7 +106,7 @@ public class SimpleTestClassModel implements TestClassModel {
private Set<String> excludesStripOneDirectory(@NotNull String directoryName) {
if (excludeDirs.isEmpty()) return excludeDirs;
Set<String> result = new LinkedHashSet<String>();
Set<String> result = new LinkedHashSet<>();
for (String excludeDir : excludeDirs) {
int firstSlash = excludeDir.indexOf('/');
if (firstSlash >= 0 && excludeDir.substring(0, firstSlash).equals(directoryName)) {