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
@@ -95,9 +95,9 @@ public abstract class CommonCompilerArguments implements Serializable {
@ValueDescription(PLUGIN_OPTION_FORMAT)
public String[] pluginOptions;
public List<String> freeArgs = new SmartList<String>();
public List<String> freeArgs = new SmartList<>();
public List<String> unknownExtraFlags = new SmartList<String>();
public List<String> unknownExtraFlags = new SmartList<>();
@NotNull
public static CommonCompilerArguments createDefaultInstance() {
@@ -82,7 +82,7 @@ public class GroupingMessageCollector implements MessageCollector {
@NotNull
private Collection<String> sortedKeys() {
List<String> sortedKeys = new ArrayList<String>(groupedMessages.keySet());
List<String> sortedKeys = new ArrayList<>(groupedMessages.keySet());
// ensure that messages with no location i.e. perf, incomplete hierarchy are always reported first
sortedKeys.sort((o1, o2) -> {
if (o1 == o2) return 0;
@@ -75,7 +75,7 @@ public class ModuleXmlParser {
}
private final MessageCollector messageCollector;
private final List<Module> modules = new SmartList<Module>();
private final List<Module> modules = new SmartList<>();
private DefaultHandler currentState;
private ModuleXmlParser(@NotNull MessageCollector messageCollector) {
@@ -261,7 +261,7 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
);
}
Map<LanguageFeature, LanguageFeature.State> extraLanguageFeatures = new HashMap<LanguageFeature, LanguageFeature.State>(0);
Map<LanguageFeature, LanguageFeature.State> extraLanguageFeatures = new HashMap<>(0);
if (arguments.multiPlatform) {
extraLanguageFeatures.put(LanguageFeature.MultiPlatformProjects, LanguageFeature.State.ENABLED);
}
@@ -69,7 +69,7 @@ import static org.jetbrains.kotlin.cli.common.UtilsKt.checkKotlinPackageUsage;
import static org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation.NO_LOCATION;
public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
private static final Map<String, ModuleKind> moduleKindMap = new HashMap<String, ModuleKind>();
private static final Map<String, ModuleKind> moduleKindMap = new HashMap<>();
static {
moduleKindMap.put(K2JsArgumentConstants.MODULE_PLAIN, ModuleKind.PLAIN);
@@ -273,7 +273,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
configuration.put(JSConfigurationKeys.META_INFO, true);
}
List<String> libraries = new SmartList<String>();
List<String> libraries = new SmartList<>();
if (!arguments.noStdlib) {
libraries.add(0, PathUtil.getKotlinPathsForCompiler().getJsStdLibJarPath().getAbsolutePath());
}