Source:
<code>public void onBind() { view.getSubmitButton().addListener(Events.OnClick, new Listener<BaseEvent>() { @Override public void handleEvent(BaseEvent be) { if (!view.getMainPanel().isValid()) { N10N.message(I18N.CONSTANTS.createFormIncomplete(), I18N.MESSAGES.createFormIncompleteDetails(I18N.CONSTANTS.adminImportationScheme()), MessageType.INFO); return; } Map<String, Object> newImportationSchemeModelProperties = new HashMap<String, Object>(); newImportationSchemeModelProperties.put(AdminUtil.ADMIN_SCHEMA, view.getSchemasCombo().getValue()); if (model instanceof ProjectModelDTO) { newImportationSchemeModelProperties.put(AdminUtil.ADMIN_PROJECT_MODEL, model); } else if (model instanceof OrgUnitDTO) { newImportationSchemeModelProperties.put(AdminUtil.ADMIN_ORG_UNIT_MODEL, model); <START> } else { <END> newImportationSchemeModelProperties.put(AdminUtil.ADMIN_CONTACT_MODEL, model); } newImportationSchemeModelProperties.put(AdminUtil.ADMIN_IMPORTATION_SCHEME_MODEL, new ImportationSchemeModelDTO()); CreateEntity cmd = new CreateEntity(ImportationSchemeModelDTO.ENTITY_NAME, newImportationSchemeModelProperties); dispatch.execute(cmd, new CommandResultHandler<CreateResult>() { @Override protected void onCommandSuccess(CreateResult result) { eventBus.fireEvent(new UpdateEvent(UpdateEvent.IMPORTATION_SCHEME_MODEL_UPDATE, model, result.getEntity())); hideView(); } @Override protected void onCommandFailure(Throwable caught) { hideView(); } }, new LoadingMask(view.getMainPanel())); } }); }</code><technical_language>more precise expectations else if (model instanceOf ContactDTO) (or suitable class) finishing a catchall else throwing IllegalArgumentException? issue line 200</technical_language>

Target:
public void onBind() { view.getSubmitButton().addListener(Events.OnClick, new Listener<BaseEvent>() { @Override public void handleEvent(BaseEvent be) { if (!view.getMainPanel().isValid()) { N10N.message(I18N.CONSTANTS.createFormIncomplete(), I18N.MESSAGES.createFormIncompleteDetails(I18N.CONSTANTS.adminImportationScheme()), MessageType.INFO); return; } Map<String, Object> newImportationSchemeModelProperties = new HashMap<String, Object>(); newImportationSchemeModelProperties.put(AdminUtil.ADMIN_SCHEMA, view.getSchemasCombo().getValue()); if (model instanceof OrgUnitModelDTO) { newImportationSchemeModelProperties.put(AdminUtil.ADMIN_ORG_UNIT_MODEL, model); } else if (model instanceof ProjectModelDTO) { newImportationSchemeModelProperties.put(AdminUtil.ADMIN_PROJECT_MODEL, model); } else if (model instanceof ContactModelDTO) { newImportationSchemeModelProperties.put(AdminUtil.ADMIN_CONTACT_MODEL, model); } else { throw new IllegalArgumentException("Invalid model type"); } newImportationSchemeModelProperties.put(AdminUtil.ADMIN_IMPORTATION_SCHEME_MODEL, new ImportationSchemeModelDTO()); CreateEntity cmd = new CreateEntity(ImportationSchemeModelDTO.ENTITY_NAME, newImportationSchemeModelProperties); dispatch.execute(cmd, new CommandResultHandler<CreateResult>() { @Override protected void onCommandSuccess(CreateResult result) { eventBus.fireEvent(new UpdateEvent(UpdateEvent.IMPORTATION_SCHEME_MODEL_UPDATE, model, result.getEntity())); hideView(); } @Override protected void onCommandFailure(Throwable caught) { hideView(); } }, new LoadingMask(view.getMainPanel())); } }); }