Commit 5ba97af7 authored by Lionel Seinturier's avatar Lionel Seinturier
Browse files

Use diamond operator whenever possible.

Use diamond operator whenever possible.
parent 78fc9183
......@@ -103,7 +103,7 @@ public class CompileSupportImpl implements CompileSupportItf {
/*
* Prepare the source files.
*/
List<JavaFileObject> jfos = new ArrayList<JavaFileObject>();
List<JavaFileObject> jfos = new ArrayList<>();
for (SourceFile sf : sfs) {
JavaFileObject jfo = new JavaSourceFromSourceFile(sf,encoding);
jfos.add(jfo);
......@@ -164,13 +164,13 @@ public class CompileSupportImpl implements CompileSupportItf {
StandardJavaFileManager stdFileManager =
compiler.getStandardFileManager(null,null,sourceCharset);
JavaFileManagerLogger<JavaFileManager> fileManager =
new JavaFileManagerLogger<JavaFileManager>(stdFileManager);
new JavaFileManagerLogger<>(stdFileManager);
/*
* Compile the code.
*/
DiagnosticCollector<JavaFileObject> dc =
new DiagnosticCollector<JavaFileObject>();
new DiagnosticCollector<>();
CompilationTask ct =
compiler.getTask(null,fileManager,dc,options,null,jfos);
boolean success = ct.call();
......
......@@ -97,7 +97,7 @@ public class CompileSupportImpl implements CompileSupportItf {
* Dump compiled files to disk.
*/
String path = classDir.getAbsolutePath();
List<String> outputFileNames = new ArrayList<String>();
List<String> outputFileNames = new ArrayList<>();
List<ClassFile> cfiles = jdtcompiler.getClassFiles();
for (ClassFile cfile : cfiles) {
String filename = new String(cfile.fileName())+".class";
......@@ -162,8 +162,7 @@ public class CompileSupportImpl implements CompileSupportItf {
getICompilationUnitMap( List<SourceFile> sfs, String encoding )
throws IOException {
Map<ICompilationUnit,SourceFile> units =
new HashMap<ICompilationUnit,SourceFile>();
Map<ICompilationUnit,SourceFile> units = new HashMap<>();
for (SourceFile sf : sfs) {
ICompilationUnit unit = getUnit(sf,encoding);
units.put(unit,sf);
......
......@@ -59,7 +59,7 @@ public class CompilerRequestorImpl implements ICompilerRequestor {
public void init( Map<ICompilationUnit,SourceFile> units ) {
this.units = units;
classFiles = new ArrayList<ClassFile>();
classFiles = new ArrayList<>();
}
public void acceptResult( CompilationResult result ) {
......
......@@ -166,7 +166,7 @@ public class JDTCompiler extends Compiler {
JuliacConfig jconf = jc.getJuliacConfig();
ClassLoader classLoader = jconf.getClassLoader();
List<String> sources = new ArrayList<String>(sfs.size());
List<String> sources = new ArrayList<>(sfs.size());
for (SourceFile sf : sfs) {
String qname = sf.getQname();
sources.add(qname);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment