< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java

Print this page
rev 48934 : 8198552: Multiple javac plugins do not work at the same time.
Summary: Fixing handling of multiple -Xplugin, -Xdoclint: and -Xdoclint/packages: parameters.
Reviewed-by: TBD


 819         String xdoclintCustom = options.get(Option.XDOCLINT_CUSTOM);
 820         if (xdoclint == null && xdoclintCustom == null)
 821             return List.nil();
 822 
 823         Set<String> doclintOpts = new LinkedHashSet<>();
 824         if (xdoclint != null)
 825             doclintOpts.add(DocLint.XMSGS_OPTION);
 826         if (xdoclintCustom != null) {
 827             for (String s: xdoclintCustom.split("\\s+")) {
 828                 if (s.isEmpty())
 829                     continue;
 830                 doclintOpts.add(DocLint.XMSGS_CUSTOM_PREFIX + s);
 831             }
 832         }
 833 
 834         if (doclintOpts.equals(Collections.singleton(DocLint.XMSGS_CUSTOM_PREFIX + "none")))
 835             return List.nil();
 836 
 837         String checkPackages = options.get(Option.XDOCLINT_PACKAGE);
 838         if (checkPackages != null) {
 839             for (String s : checkPackages.split("\\s+")) {
 840                 doclintOpts.add(DocLint.XCHECK_PACKAGE + s);
 841             }
 842         }
 843 
 844         String format = options.get(Option.DOCLINT_FORMAT);
 845         if (format != null) {
 846             doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + format);
 847         }
 848 
 849         // standard doclet normally generates H1, H2,
 850         // so for now, allow user comments to assume that
 851         doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
 852         return List.from(doclintOpts.toArray(new String[doclintOpts.size()]));
 853     }
 854 
 855     private boolean checkDirectory(Option option) {
 856         String value = options.get(option);
 857         if (value == null) {
 858             return true;
 859         }
 860         Path file = Paths.get(value);
 861         if (Files.exists(file) && !Files.isDirectory(file)) {




 819         String xdoclintCustom = options.get(Option.XDOCLINT_CUSTOM);
 820         if (xdoclint == null && xdoclintCustom == null)
 821             return List.nil();
 822 
 823         Set<String> doclintOpts = new LinkedHashSet<>();
 824         if (xdoclint != null)
 825             doclintOpts.add(DocLint.XMSGS_OPTION);
 826         if (xdoclintCustom != null) {
 827             for (String s: xdoclintCustom.split("\\s+")) {
 828                 if (s.isEmpty())
 829                     continue;
 830                 doclintOpts.add(DocLint.XMSGS_CUSTOM_PREFIX + s);
 831             }
 832         }
 833 
 834         if (doclintOpts.equals(Collections.singleton(DocLint.XMSGS_CUSTOM_PREFIX + "none")))
 835             return List.nil();
 836 
 837         String checkPackages = options.get(Option.XDOCLINT_PACKAGE);
 838         if (checkPackages != null) {
 839             doclintOpts.add(DocLint.XCHECK_PACKAGE + checkPackages);


 840         }
 841 
 842         String format = options.get(Option.DOCLINT_FORMAT);
 843         if (format != null) {
 844             doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + format);
 845         }
 846 
 847         // standard doclet normally generates H1, H2,
 848         // so for now, allow user comments to assume that
 849         doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
 850         return List.from(doclintOpts.toArray(new String[doclintOpts.size()]));
 851     }
 852 
 853     private boolean checkDirectory(Option option) {
 854         String value = options.get(option);
 855         if (value == null) {
 856             return true;
 857         }
 858         Path file = Paths.get(value);
 859         if (Files.exists(file) && !Files.isDirectory(file)) {


< prev index next >