### Eclipse Workspace Patch 1.0 #P magnolia-module-admininterface Index: src/main/java/info/magnolia/module/admininterface/DialogMVCHandler.java =================================================================== --- src/main/java/info/magnolia/module/admininterface/DialogMVCHandler.java (revision 37335) +++ src/main/java/info/magnolia/module/admininterface/DialogMVCHandler.java (working copy) @@ -275,7 +275,7 @@ */ protected SaveHandler getSaveHandler() { if (this.saveHandler == null) { - createSaveHandler(); + this.saveHandler = createSaveHandler(); configureSaveHandler(this.saveHandler); } @@ -286,13 +286,14 @@ * If there is the property saveHandler defined in the config it instantiates the configured save handler. Else it * instantiates the default save handler */ - protected void createSaveHandler() { + protected SaveHandler createSaveHandler() { + SaveHandler sh = null; Content configNode = this.getConfigNode(); if (configNode != null) { String className = NodeDataUtil.getString(configNode, "saveHandler"); if (StringUtils.isNotEmpty(className)) { try { - this.saveHandler = Classes.newInstance(className); + sh = Classes.newInstance(className); } catch (MgnlInstantiationException e) { log.error("can't create save handler", e); @@ -303,9 +304,7 @@ } } - if (this.saveHandler == null) { - this.saveHandler = Components.getComponentProvider().newInstance(SaveHandler.class); - } + return (sh == null) ? Components.getComponentProvider().newInstance(SaveHandler.class) : sh; } /** @@ -321,7 +320,7 @@ saveHandler.setRepository(form.getParameter("mgnlRepository")); //$NON-NLS-1$ saveHandler.setCreationItemType(new ItemType(getItemType())); - if (this.saveHandler instanceof DialogAwareSaveHandler) { + if (saveHandler instanceof DialogAwareSaveHandler) { ((DialogAwareSaveHandler) saveHandler).setDialog(this.getDialog()); } }