Source:
<code>private List<String> importOpenApiDefinition(final Scheme defaultScheme, final String defaultHost, final String defn, final String hostOverride, final boolean initViaUi) { final List<String> errors = new ArrayList<String>(); Thread t = new Thread(THREAD_PREFIX + threadId++) { @Override public void run() { try { Requestor requestor = new Requestor(HttpSender.MANUAL_REQUEST_INITIATOR); requestor.setSiteOverride(hostOverride); requestor.addListener(new HistoryPersister()); SwaggerConverter converter = new SwaggerConverter( defaultScheme, StringUtils.isNotEmpty(hostOverride) ? hostOverride : defaultHost, defn, getValueGenerator()); errors.addAll(requestor.run(converter.getRequestModels())); errors.addAll(converter.getErrorMessages()); if (errors.size() > 0) { logErrors(errors, initViaUi); if (initViaUi) { View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.warn")); } } else { if (initViaUi) { View.getSingleton().showMessageDialog(Constant.messages.getString("openapi.parse.ok")); } } } catch (Exception e) { if (initViaUi) { <START> View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.error", e.getMessage())); <END> } logErrors(errors, initViaUi); LOG.warn(e.getMessage(), e); } } }; t.start(); if (! initViaUi) { try { t.join(); } catch (InterruptedException e) { LOG.debug(e.getMessage(), e); } return errors; } return null; }</code><technical_language>hardcode a limit for text shown in dialogue (or change messages?). Some of messages include definition imported (e.g. try import a JSON definition a missing curly bracket). worth internationalise message(s) shown in UI</technical_language>

Target:
private List<String> importOpenApiDefinition(final Scheme defaultScheme, final String defaultHost, final String defn, final String hostOverride, final boolean initViaUi) { final List<String> errors = new ArrayList<String>(); Thread t = new Thread(THREAD_PREFIX + threadId++) { @Override public void run() { try { Requestor requestor = new Requestor(HttpSender.MANUAL_REQUEST_INITIATOR); requestor.setSiteOverride(hostOverride); requestor.addListener(new HistoryPersister()); SwaggerConverter converter = new SwaggerConverter( defaultScheme, StringUtils.isNotEmpty(hostOverride) ? hostOverride : defaultHost, defn, getValueGenerator()); errors.addAll(requestor.run(converter.getRequestModels())); errors.addAll(converter.getErrorMessages()); if (errors.size() > 0) { logErrors(errors, initViaUi); if (initViaUi) { View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.warn")); } } else { if (initViaUi) { View.getSingleton().showMessageDialog(Constant.messages.getString("openapi.parse.ok")); } } } catch (Exception e) { if (initViaUi) { String exMsg = e.getLocalizedMessage(); exMsg = exMsg.length() >= 125 ? exMsg.substring(0, 122) + "..." : exMsg; View.getSingleton().showWarningDialog(Constant.messages.getString("openapi.parse.error", exMsg) + "\n\n" + Constant.messages.getString("openapi.parse.trailer")); } logErrors(errors, initViaUi); LOG.warn(e.getMessage(), e); } } }; t.start(); if (! initViaUi) { try { t.join(); } catch (InterruptedException e) { LOG.debug(e.getMessage(), e); } return errors; } return null; }