1.1 --- a/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Tue Jul 05 16:37:24 2011 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Thu Jul 07 13:29:31 2011 -0700 1.3 @@ -158,10 +158,10 @@ 1.4 } else { 1.5 initContext(); 1.6 compilerMain.setOptions(Options.instance(context)); 1.7 - compilerMain.filenames = new ListBuffer<File>(); 1.8 - List<File> filenames = compilerMain.processArgs(CommandLine.parse(args)); 1.9 + compilerMain.filenames = new LinkedHashSet<File>(); 1.10 + Collection<File> filenames = compilerMain.processArgs(CommandLine.parse(args)); 1.11 if (!filenames.isEmpty()) 1.12 - throw new IllegalArgumentException("Malformed arguments " + filenames.toString(" ")); 1.13 + throw new IllegalArgumentException("Malformed arguments " + toString(filenames, " ")); 1.14 compiler = JavaCompiler.instance(context); 1.15 compiler.keepComments = true; 1.16 compiler.genEndPos = true; 1.17 @@ -177,6 +177,17 @@ 1.18 } 1.19 } 1.20 1.21 + <T> String toString(Iterable<T> items, String sep) { 1.22 + String currSep = ""; 1.23 + StringBuilder sb = new StringBuilder(); 1.24 + for (T item: items) { 1.25 + sb.append(currSep); 1.26 + sb.append(item.toString()); 1.27 + currSep = sep; 1.28 + } 1.29 + return sb.toString(); 1.30 + } 1.31 + 1.32 private void initContext() { 1.33 context.put(JavacTaskImpl.class, this); 1.34 if (context.get(TaskListener.class) != null)