1.1 --- a/src/share/classes/com/sun/tools/javac/main/Main.java Tue Jul 05 16:37:24 2011 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/main/Main.java Thu Jul 07 13:29:31 2011 -0700 1.3 @@ -31,7 +31,10 @@ 1.4 import java.net.URL; 1.5 import java.security.DigestInputStream; 1.6 import java.security.MessageDigest; 1.7 +import java.util.Collection; 1.8 +import java.util.LinkedHashSet; 1.9 import java.util.MissingResourceException; 1.10 +import java.util.Set; 1.11 import javax.tools.JavaFileManager; 1.12 import javax.tools.JavaFileObject; 1.13 import javax.annotation.processing.Processor; 1.14 @@ -107,8 +110,7 @@ 1.15 } 1.16 1.17 public void addFile(File f) { 1.18 - if (!filenames.contains(f)) 1.19 - filenames.append(f); 1.20 + filenames.add(f); 1.21 } 1.22 1.23 public void addClassName(String s) { 1.24 @@ -136,7 +138,7 @@ 1.25 1.26 /** The list of source files to process 1.27 */ 1.28 - public ListBuffer<File> filenames = null; // XXX sb protected 1.29 + public Set<File> filenames = null; // XXX sb protected 1.30 1.31 /** List of class files names passed on the command line 1.32 */ 1.33 @@ -202,7 +204,7 @@ 1.34 * in `options' table and return all source filenames. 1.35 * @param flags The array of command line arguments. 1.36 */ 1.37 - public List<File> processArgs(String[] flags) { // XXX sb protected 1.38 + public Collection<File> processArgs(String[] flags) { // XXX sb protected 1.39 int ac = 0; 1.40 while (ac < flags.length) { 1.41 String flag = flags[ac]; 1.42 @@ -294,7 +296,7 @@ 1.43 showClass(showClass); 1.44 } 1.45 1.46 - return filenames.toList(); 1.47 + return filenames; 1.48 } 1.49 // where 1.50 private boolean checkDirectory(OptionName optName) { 1.51 @@ -342,7 +344,7 @@ 1.52 if (options == null) 1.53 options = Options.instance(context); // creates a new one 1.54 1.55 - filenames = new ListBuffer<File>(); 1.56 + filenames = new LinkedHashSet<File>(); 1.57 classnames = new ListBuffer<String>(); 1.58 JavaCompiler comp = null; 1.59 /* 1.60 @@ -356,7 +358,7 @@ 1.61 return EXIT_CMDERR; 1.62 } 1.63 1.64 - List<File> files; 1.65 + Collection<File> files; 1.66 try { 1.67 files = processArgs(CommandLine.parse(args)); 1.68 if (files == null) {