void () { if (!needPatternConversion()) { return; } try { boolean ok; try { ok = doConvertPatterns(); } catch (MalformedPatternException ignored) { ok = false; } if (!ok) { final String initialPatternString = patternsToString(getRegexpPatterns()); final String message = JavaCompilerBundle.message( "message.resource.patterns.format.changed", ApplicationNamesInfo.getInstance().getProductName(), initialPatternString, CommonBundle.getOkButtonText(), CommonBundle.getCancelButtonText() ); final String wildcardPatterns = Messages.showInputDialog( myProject, message, JavaCompilerBundle.message("pattern.conversion.dialog.title"), Messages.getWarningIcon(), initialPatternString, new InputValidator() { @Override public boolean checkInput(String inputString) { return true; } @Override public boolean canClose(String inputString) { final StringTokenizer tokenizer = new StringTokenizer(inputString, ";", false); StringBuilder malformedPatterns = new StringBuilder(); while (tokenizer.hasMoreTokens()) { String pattern = tokenizer.nextToken(); try { addWildcardResourcePattern(pattern); } catch (MalformedPatternException e) { malformedPatterns.append("\n\n"); malformedPatterns.append(pattern); malformedPatterns.append(": "); malformedPatterns.append(e.getMessage()); } } if (malformedPatterns.length() > 0) { Messages.showErrorDialog(JavaCompilerBundle.message("error.bad.resource.patterns", malformedPatterns.toString()), JavaCompilerBundle.message("bad.resource.patterns.dialog.title")); removeWildcardPatterns(); return false; } return true; } }); if (wildcardPatterns == null) { // cancel pressed loadDefaultWildcardPatterns(); } } } finally { myWildcardPatternsInitialized = true; } }