equal
deleted
inserted
replaced
354 DiagnosticListener<? super JavaFileObject> diagnosticListener, |
354 DiagnosticListener<? super JavaFileObject> diagnosticListener, |
355 Iterable<String> options, |
355 Iterable<String> options, |
356 Iterable<String> classes) { |
356 Iterable<String> classes) { |
357 this(out, fileManager, diagnosticListener); |
357 this(out, fileManager, diagnosticListener); |
358 |
358 |
359 this.classes = new ArrayList<String>(); |
359 this.classes = new ArrayList<>(); |
360 for (String classname: classes) { |
360 for (String classname: classes) { |
361 classname.getClass(); // null-check |
361 classname.getClass(); // null-check |
362 this.classes.add(classname); |
362 this.classes.add(classname); |
363 } |
363 } |
364 |
364 |
510 String arg = iter.next(); |
510 String arg = iter.next(); |
511 if (arg.startsWith("-")) |
511 if (arg.startsWith("-")) |
512 handleOption(arg, iter); |
512 handleOption(arg, iter); |
513 else if (allowClasses) { |
513 else if (allowClasses) { |
514 if (classes == null) |
514 if (classes == null) |
515 classes = new ArrayList<String>(); |
515 classes = new ArrayList<>(); |
516 classes.add(arg); |
516 classes.add(arg); |
517 while (iter.hasNext()) |
517 while (iter.hasNext()) |
518 classes.add(iter.next()); |
518 classes.add(iter.next()); |
519 } else |
519 } else |
520 throw new BadArgs("err.unknown.option", arg).showUsage(true); |
520 throw new BadArgs("err.unknown.option", arg).showUsage(true); |
986 public String getMessage(Locale locale, String key, Object... args) { |
986 public String getMessage(Locale locale, String key, Object... args) { |
987 if (bundles == null) { |
987 if (bundles == null) { |
988 // could make this a HashMap<Locale,SoftReference<ResourceBundle>> |
988 // could make this a HashMap<Locale,SoftReference<ResourceBundle>> |
989 // and for efficiency, keep a hard reference to the bundle for the task |
989 // and for efficiency, keep a hard reference to the bundle for the task |
990 // locale |
990 // locale |
991 bundles = new HashMap<Locale, ResourceBundle>(); |
991 bundles = new HashMap<>(); |
992 } |
992 } |
993 |
993 |
994 if (locale == null) |
994 if (locale == null) |
995 locale = Locale.getDefault(); |
995 locale = Locale.getDefault(); |
996 |
996 |