138 return Collections.unmodifiableSet(set); 139 } 140 141 @Override 142 public String getDescription() { 143 return PluginsResourceBundle.getDescription(NAME); 144 } 145 146 @Override 147 public boolean hasArguments() { 148 return true; 149 } 150 151 @Override 152 public String getArgumentsDescription() { 153 return PluginsResourceBundle.getArgument(NAME); 154 } 155 156 @Override 157 public void configure(Map<String, String> config) { 158 try { 159 priorityList = Arrays.stream(config.get(NAME).split(",")) 160 .map(Locale.LanguageRange::new) 161 .collect(Collectors.toList()); 162 } catch (IllegalArgumentException iae) { 163 throw new PluginException(iae.getLocalizedMessage()); 164 } 165 } 166 167 @Override 168 public void previsit(Pool resources, StringTable strings) { 169 final Pattern p = Pattern.compile(".*((Data_)|(Names_))(?<tag>.*)\\.class"); 170 Pool.Module module = resources.getModule(MODULENAME); 171 172 // jdk.localedata module validation 173 Set<String> packages = module.getAllPackages(); 174 if (!packages.containsAll(LOCALEDATA_PACKAGES)) { 175 throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".missingpackages") + 176 LOCALEDATA_PACKAGES.stream() 177 .filter(pn -> !packages.contains(pn)) 178 .collect(Collectors.joining(",\n\t"))); 179 } 180 181 available = Stream.concat(module.getContent().stream() 182 .map(md -> p.matcher(md.getPath())) 183 .filter(m -> m.matches()) 184 .map(m -> m.group("tag").replaceAll("_", "-")), | 138 return Collections.unmodifiableSet(set); 139 } 140 141 @Override 142 public String getDescription() { 143 return PluginsResourceBundle.getDescription(NAME); 144 } 145 146 @Override 147 public boolean hasArguments() { 148 return true; 149 } 150 151 @Override 152 public String getArgumentsDescription() { 153 return PluginsResourceBundle.getArgument(NAME); 154 } 155 156 @Override 157 public void configure(Map<String, String> config) { 158 priorityList = Arrays.stream(config.get(NAME).split(",")) 159 .map(Locale.LanguageRange::new) 160 .collect(Collectors.toList()); 161 } 162 163 @Override 164 public void previsit(Pool resources, StringTable strings) { 165 final Pattern p = Pattern.compile(".*((Data_)|(Names_))(?<tag>.*)\\.class"); 166 Pool.Module module = resources.getModule(MODULENAME); 167 168 // jdk.localedata module validation 169 Set<String> packages = module.getAllPackages(); 170 if (!packages.containsAll(LOCALEDATA_PACKAGES)) { 171 throw new PluginException(PluginsResourceBundle.getMessage(NAME + ".missingpackages") + 172 LOCALEDATA_PACKAGES.stream() 173 .filter(pn -> !packages.contains(pn)) 174 .collect(Collectors.joining(",\n\t"))); 175 } 176 177 available = Stream.concat(module.getContent().stream() 178 .map(md -> p.matcher(md.getPath())) 179 .filter(m -> m.matches()) 180 .map(m -> m.group("tag").replaceAll("_", "-")), |