[jbosstools-dev] Re: Fwd: [jbosstools-commits] JBoss Tools SVN: r7342 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf: model and 7 other directories.

Max Rydahl Andersen max.andersen at redhat.com
Tue Apr 8 03:41:33 EDT 2008


Slava - did you get this ?

/max

> Hi Slava,
>
> Aren't these exception changes a bit dangerous or ? (see questions inline)
>
> e.g.
> @@ -41,6 +43,7 @@
> 		XModel initialModel = PreferenceModelUtilities.createPreferenceModel(p);
> 		if (initialModel != null)
> 		{
> +			try {
> 			PreferenceModelUtilities.initPreferenceValue(initialModel, JSFPreference.USE_DEFAULT_JSF_PROJECT_ROOT);
> 			PreferenceModelUtilities.initPreferenceValue(initialModel, JSFPreference.DEFAULT_JSF_VERSION);
> 			PreferenceModelUtilities.initPreferenceValue(initialModel, JSFPreference.DEFAULT_JSF_PROJECT_TEMPLATE);
> @@ -48,6 +51,9 @@
> 			PreferenceModelUtilities.initPreferenceValue(initialModel, JSFPreference.DEFAULT_JSF_SERVLET_VERSION);
> 			PreferenceModelUtilities.initPreferenceValue(initialModel, JSFPreference.REGISTER_NEW_JSF_PROJECT_IN_SERVER);
> 			PreferenceModelUtilities.initPreferenceValue(initialModel, JSFPreference.REGISTER_IMPORTED_JSF_PROJECT_IN_SERVER);
> +			} catch (XModelException e) {
> +				ModelPlugin.getPluginLog().logError(e);
> +			}
> 			
> 			PreferenceModelUtilities.getPreferenceModel().save();
> 		}
>
> Why do we start swalloing an exception here ?
>
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -120,6 +120,9 @@
> 		f.setUpdateLock();
> 		try {
> 			f.edit(body, true);
> +		} catch (XModelException e) {
> +			//TODO throw XModelException
> +			throw new RuntimeException(e);
> 		} finally {
> 			f.releaseUpdateLock();
> 		}
>
> Why at a random throw runtimexception here when we didn't do it before ?
>
> And then *alot* of methods now suddenly throws an XModelException where none where declared before ...is that really what you want ?
>
> /max
>
> @@ -24,7 +25,7 @@
> 		return false;
> 	}
>
> -	public void adopt(XModelObject target, XModelObject object, Properties p) {
> +	public void adopt(XModelObject target, XModelObject object, Properties p) throws XModelException {
> 		if(jspAdopt.isAdoptablePage(object)) adoptPage(target, object, p);
> 		else if(isAdoptableBundle(object)) adoptBundle(target, object, p);
> 	}
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/GroupAdopt.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/GroupAdopt.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/GroupAdopt.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -67,7 +67,7 @@
> 		return (case_ != null && rule == null || rule != case_.getParent());
> 	}
>
> -	public void adopt(XModelObject target, XModelObject object, Properties p) {
> +	public void adopt(XModelObject target, XModelObject object, Properties p) throws XModelException {
> 		String entity = object.getModelEntity().getName();
> 		if(ENT_PROCESS_ITEM_OUTPUT.equals(entity)) {
> 			if(move_case) {
> @@ -82,21 +82,21 @@
> 		else if(ENT_NAVIGATION_CASE.equals(entity)) adoptCase(object, target, p);
> 	}
> 	
> -	protected void adoptOutput(XModelObject source, XModelObject target, Properties p) {
> +	protected void adoptOutput(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		ReferenceObjectImpl i = (ReferenceObjectImpl)source;
> 		adoptCase(i.getReference(), target, p);
> 	}
>
> -	protected void adoptCase(XModelObject source, XModelObject target, Properties p) {
> +	protected void adoptCase(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		source.getModel().changeObjectAttribute(source, ATT_TO_VIEW_ID, target.getAttributeValue(ATT_PATH));
> 	}
>
> -	protected void adoptItem(XModelObject source, XModelObject target, Properties p) {
> +	protected void adoptItem(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		ReferenceObjectImpl i = (ReferenceObjectImpl)source;
> 		adoptRule(i.getReference(), target, p);
> 	}
>
> -	protected void adoptRule(XModelObject source, XModelObject target, Properties p) {
> +	protected void adoptRule(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		String path = target.getAttributeValue(ATT_PATH);
> 		String n = path;
> 		if(n.lastIndexOf('.') > 0) n = n.substring(0, n.lastIndexOf('.'));
> @@ -110,7 +110,7 @@
> 		DefaultCreateHandler.addCreatedObject(source, cs, p);
> 	}
>
> -	protected void adoptGroup(XModelObject source, XModelObject target, Properties p) {
> +	protected void adoptGroup(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		ReferenceGroupImpl g = (ReferenceGroupImpl)source;
> 		XModelObject[] os = g.getReferences();
> 		if(os != null && os.length > 0) {
> @@ -134,12 +134,12 @@
> 		}
> 	}
> 	
> -	void moveOutput(XModelObject source, XModelObject target, Properties p) {
> +	void moveOutput(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		ReferenceObjectImpl i = (ReferenceObjectImpl)source;
> 		moveCase(i.getReference(), target, p);
> 	}
>
> -	void moveCase(XModelObject source, XModelObject target, Properties p) {
> +	void moveCase(XModelObject source, XModelObject target, Properties p) throws XModelException {
> 		XModelObject rule = null;
> 		if(target instanceof ReferenceGroupImpl) {
> 			rule = ((ReferenceGroupImpl)target).getReference();
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/JSPAdopt.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/JSPAdopt.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/JSPAdopt.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -36,7 +36,7 @@
>                isAdoptableMapEntry(object);
>     }
>
> -    public void adopt(XModelObject target, XModelObject object, java.util.Properties p) {
> +    public void adopt(XModelObject target, XModelObject object, java.util.Properties p) throws XModelException {
>         if(isAdoptableProperty(object)) adoptProperty(target, object, p);
> 		else if(isAdoptablePropertyReference(object)) adoptPropertyReference(target, object, p);
> 		else if(isAdoptablePage(object)) adoptPage(target, object, p);
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/ProcessAdopt.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/ProcessAdopt.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/ProcessAdopt.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -14,6 +14,7 @@
> import org.jboss.tools.common.meta.XAdoptManager;
> import org.jboss.tools.common.meta.action.XActionInvoker;
> import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.XModelObject;
> import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
> import org.jboss.tools.jsf.JSFPreference;
> @@ -22,7 +23,7 @@
>
> public class ProcessAdopt implements XAdoptManager, JSFConstants {
>
> -	public void adopt(XModelObject target, XModelObject object, java.util.Properties p) {
> +	public void adopt(XModelObject target, XModelObject object, java.util.Properties p) throws XModelException {
> 		if(isAdoptableJSP(target, object)) {
> 			adoptJSP(target, object, p);
> 		} else if(isAdoptableItem(target, object)) {
> @@ -53,7 +54,7 @@
> 		return false;
> 	}
>
> -	private void adoptJSP(XModelObject target, XModelObject object, Properties p) {
> +	private void adoptJSP(XModelObject target, XModelObject object, Properties p) throws XModelException {
> 		if (target.getModelEntity().getName().startsWith(ENT_FACESCONFIG)) {
> 			target = target.getChildByPath(ELM_PROCESS);
> 		}
> @@ -66,7 +67,7 @@
> */
> 	}
>
> -	private void addRuleByPageAdopt(XModelObject process, XModelObject page, Properties p) {
> +	private void addRuleByPageAdopt(XModelObject process, XModelObject page, Properties p) throws XModelException {
> 		String path = XModelObjectLoaderUtil.getResourcePath(page);
> 		XModelObject group = JSFProcessHelper.getHelper(process).getPage(path);
> 		if(group != null) return;
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RenameViewSupport.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RenameViewSupport.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RenameViewSupport.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -110,7 +110,7 @@
> 		return true;
> 	}
> 	
> -	public static void replace(ReferenceGroupImpl group, String oldPath, String newPath) {
> +	public static void replace(ReferenceGroupImpl group, String oldPath, String newPath) throws XModelException {
> 		String pp = NavigationRuleObjectImpl.toNavigationRulePathPart(newPath);
> 		boolean isPattern = JSFProcessHelper.isPattern(newPath);
> 		XModel model = group.getModel();
> @@ -184,7 +184,7 @@
> 	 * the item will be extracted from this group and added to the other,
> 	 * or new group will be created.
> 	 */	
> -	private void extract(String oldPath, String newPath) {
> +	private void extract(String oldPath, String newPath) throws XModelException {
> 		String pp = NavigationRuleObjectImpl.toNavigationRulePathPart(newPath);
> //		boolean isPattern = JSFProcessHelper.isPattern(newPath);
> 		XModel model = group.getModel();
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/RenameManagedBeanHandler.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/RenameManagedBeanHandler.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/RenameManagedBeanHandler.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -88,7 +88,7 @@
> 	}
> 	
> 	
> -	private void renameClass(XModelObject object, String qualifiedName) {		
> +	private void renameClass(XModelObject object, String qualifiedName) throws XModelException {		
> 		object.getModel().changeObjectAttribute(object, "managed-bean-class", qualifiedName);
> 	}
> 	
> @@ -112,7 +112,11 @@
> 						String className = toElement.getElementName();
> 						if(className.endsWith(".java")) className = className.substring(0, className.length() - 5);
> 						if(packageName.length() > 0) className = packageName + "." + className;
> -						renameClass(object, className);
> +						try {
> +							renameClass(object, className);
> +						} catch (XModelException e) {
> +							throw new RuntimeException(e);
> +						}
> 					}
> 				} finally {
> 					JavaCore.removeElementChangedListener(this);
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/refactoring/JSFRenameFolderFacesConfigChange.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/refactoring/JSFRenameFolderFacesConfigChange.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/refactoring/JSFRenameFolderFacesConfigChange.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -19,6 +19,7 @@
> import org.eclipse.ltk.core.refactoring.CompositeChange;
>
> import org.jboss.tools.common.meta.action.XActionInvoker;
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.XModelObject;
> import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
> import org.jboss.tools.jsf.messages.JSFUIMessages;
> @@ -97,7 +98,7 @@
> 		return null;
> 	}
> 	
> -	private void performChangeInFile(XModelObject f) {
> +	private void performChangeInFile(XModelObject f) throws XModelException {
> 		XModelObject[] gs = findGroups(f);
> 		if(gs.length == 0) return;
> 		JSFProcessHelper h = JSFProcessHelper.getHelper(JSFProcessStructureHelper.instance.getProcess(f));
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/refactoring/JSFRenamePageFacesConfigChange.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/refactoring/JSFRenamePageFacesConfigChange.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/refactoring/JSFRenamePageFacesConfigChange.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -18,6 +18,7 @@
> import org.eclipse.ltk.core.refactoring.CompositeChange;
>
> import org.jboss.tools.common.meta.action.XActionInvoker;
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.XModelObject;
> import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
> import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
> @@ -100,7 +101,7 @@
> 		return null;
> 	}
>
> -	private void performChangeInFile(XModelObject f) {
> +	private void performChangeInFile(XModelObject f) throws XModelException {
> 		replaceIcons(f, oldText, newText);
> 		XModelObject[] gs = findGroups(f);
> 		if(gs.length == 0) return;
> @@ -130,7 +131,7 @@
>
> 	static String[] ICON_ATTRIBUTES = {"small-icon", "large-icon"};
>
> -	static void replaceIcons(XModelObject f, String oldText, String newText) {
> +	static void replaceIcons(XModelObject f, String oldText, String newText) throws XModelException {
> 		if(oldText == null || oldText.length() == 0) return;
> 		if(f.getModelEntity().getAttribute(ICON_ATTRIBUTES[0]) != null) {
> 			for (int i = 0; i < ICON_ATTRIBUTES.length; i++) {
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/tile/TilesFileRegistration.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/tile/TilesFileRegistration.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/tile/TilesFileRegistration.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -14,7 +14,9 @@
> import org.jboss.tools.common.meta.action.SpecialWizard;
> import org.jboss.tools.common.meta.action.XActionInvoker;
> import org.jboss.tools.common.model.XModel;
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.XModelObject;
> +import org.jboss.tools.common.model.plugin.ModelPlugin;
> import org.jboss.tools.jsf.model.pv.JSFProjectTiles;
> import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
>
> @@ -37,6 +39,16 @@
>
> 	public int execute() {
> 		if(webxml == null) return 1;
> +		try {
> +			return doExecute();
> +		} catch (XModelException e) {
> +			ModelPlugin.getPluginLog().logError(e);
> +			if(p != null) p.put("exception", e);
> +			return 1;
> +		}
> +	}
> +	
> +	private int doExecute() throws XModelException {
> 		if(test) {
> 			return test();
> 		} else if(path == null && oldPath != null) {
> @@ -52,7 +64,7 @@
> 		return 0;
> 	}
> 	
> -	void append() {
> +	void append() throws XModelException {
> 		XModelObject context = WebAppHelper.findWebAppContextParam(webxml, JSFProjectTiles.TILES_DEFINITIONS_2);
> 		if(context != null) {
> 			WebAppHelper.appendToWebAppContextParam(webxml, JSFProjectTiles.TILES_DEFINITIONS_2, path);
> @@ -62,7 +74,7 @@
> 		}
> 	}
> 	
> -	void replace() {
> +	void replace() throws XModelException {
> 		XModelObject context = WebAppHelper.findWebAppContextParam(webxml, JSFProjectTiles.TILES_DEFINITIONS_2);
> 		String[] s = null;
> 		XModelObject servlet = null;
> @@ -99,7 +111,7 @@
> 		p.setProperty("success", "true");
> 	}
> 	
> -	int test() {
> +	int test() throws XModelException {
> 		if(path == null) return 1;
> 		XModelObject context = WebAppHelper.findWebAppContextParam(webxml, JSFProjectTiles.TILES_DEFINITIONS_2);
> 		String[] s = null;
> @@ -118,7 +130,7 @@
> 		return 1;
> 	}
> 	
> -	void remove() {
> +	void remove() throws XModelException {
> 		replace();
> 	}
> 	
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/ApplicationObjectImpl.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/ApplicationObjectImpl.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/ApplicationObjectImpl.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -13,6 +13,7 @@
> import java.util.Properties;
>
> import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.XModelObject;
> import org.jboss.tools.common.model.impl.*;
>
> @@ -53,7 +54,7 @@
> 		return super.setAttributeValue(name, value);
> 	}
> 	
> -	public void onAttributeValueEdit(String name, String oldValue, String newValue) {
> +	public void onAttributeValueEdit(String name, String oldValue, String newValue) throws XModelException {
> 		if(name != null && ATTR_TO_ENTITY.containsKey(name)) {
> 			String entity = ATTR_TO_ENTITY.getProperty(name);
> 			XModelObject[] cs = getChildren(entity);
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/ConverterObjectImpl.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/ConverterObjectImpl.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/ConverterObjectImpl.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -10,6 +10,7 @@
>  ******************************************************************************/
> package org.jboss.tools.jsf.model.impl;
>
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.impl.OrderedByEntityChildren;
> import org.jboss.tools.common.model.impl.OrderedObjectImpl;
> import org.jboss.tools.common.model.impl.RegularChildren;
> @@ -37,7 +38,7 @@
> 		return "" + getAttributeValue("converter-class");		
> 	}
>
> -	protected void onAttributeValueEdit(String name, String oldValue, String newValue) {
> +	protected void onAttributeValueEdit(String name, String oldValue, String newValue) throws XModelException {
> 		if("converter-id".equals(name) && newValue != null && newValue.length() > 0) {
> 			setAttributeValue("converter-for-class", "");
> 		} else if("converter-for-class".equals(name) && newValue != null && newValue.length() > 0) {
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/EntryObjectImpl.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/EntryObjectImpl.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/impl/EntryObjectImpl.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -10,6 +10,7 @@
>  ******************************************************************************/
> package org.jboss.tools.jsf.model.impl;
>
> +import org.jboss.tools.common.model.XModelException;
> import org.jboss.tools.common.model.impl.RegularObjectImpl;
>
> public class EntryObjectImpl extends RegularObjectImpl {
> @@ -29,7 +30,7 @@
> 	
> 	String cachedValue = null;
> 	
> -	protected void onAttributeValueEdit(String name, String oldValue, String newValue) {
> +	protected void onAttributeValueEdit(String name, String oldValue, String newValue) throws XModelException {
> 		if("null-value".equals(name)) {
> 			if("true".equals(newValue)) {
> 				cachedValue = getAttributeValue("value");
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/FileAdditionPerformer.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/FileAdditionPerformer.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/FileAdditionPerformer.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -20,7 +20,6 @@
> import org.jboss.tools.common.model.loaders.impl.SerializingLoader;
> import org.jboss.tools.common.model.util.*;
> import org.jboss.tools.common.xml.*;
> -import org.jboss.tools.common.xml.XMLEntityResolver;
> import org.jboss.tools.jsf.messages.JSFUIMessages;
>
> public class FileAdditionPerformer extends PerformerItem {
> @@ -186,7 +185,7 @@
> 		}
> 	}
> 	
> -	private void mergeAttributes(XModelObject object, XModelObject update) {
> +	private void mergeAttributes(XModelObject object, XModelObject update) throws XModelException {
> 		XAttribute[] as = update.getModelEntity().getAttributes();
> 		for (int i = 0; i < as.length; i++) {
> 			String xml = as[i].getXMLName();
> @@ -197,7 +196,7 @@
> 		}
> 	}
> 	
> -	private void mergeChildren(XModelObject object, XModelObject[] update) {
> +	private void mergeChildren(XModelObject object, XModelObject[] update) throws XModelException {
> 		for (int i = 0; i < update.length; i++) {
> 			String pp = update[i].getPathPart();
> 			XModelObject c = object.getChildByPath(pp);
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFTemplate.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFTemplate.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFTemplate.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -10,6 +10,8 @@
>  ******************************************************************************/
> package org.jboss.tools.jsf.web;
>
> +import org.jboss.tools.common.model.XModelException;
> +import org.jboss.tools.common.model.plugin.ModelPlugin;
> import org.jboss.tools.jsf.JSFPreference;
> import org.jboss.tools.jst.web.project.helpers.*;
> import org.jboss.tools.jst.web.project.version.*;
> @@ -44,7 +46,11 @@
> 	}
>
> 	public void setDefaultTemplate(String template) {
> -		JSFPreference.DEFAULT_JSF_PROJECT_TEMPLATE.setValue(template);
> +		try {
> +			JSFPreference.DEFAULT_JSF_PROJECT_TEMPLATE.setValue(template);
> +		} catch (XModelException e) {
> +			ModelPlugin.getPluginLog().logError(e);
> +		}
> 	}
>
> 	public String getDefaultPageTemplate() {
> @@ -53,7 +59,11 @@
> 	}
>
> 	public void setDefaultPageTemplate(String template) {
> -		JSFPreference.DEFAULT_JSF_PAGE_TEMPLATE.setValue(template);
> +		try {
> +			JSFPreference.DEFAULT_JSF_PAGE_TEMPLATE.setValue(template);
> +		} catch (XModelException e) {
> +			ModelPlugin.getPluginLog().logError(e);
> +		}
> 	}
>
> 	protected String getWizardEntitySuffix() {
>
> Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java
> ===================================================================
> --- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java	2008-04-04 16:20:03 UTC (rev 7341)
> +++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java	2008-04-04 16:20:47 UTC (rev 7342)
> @@ -47,7 +47,7 @@
> 		return getConfigFilesListAsString(webxml, FACES_CONFIG_DATA);
> 	}
> 	
> -	public static void registerFacesConfig(XModel model, String path) {
> +	public static void registerFacesConfig(XModel model, String path) throws XModelException {
> 		registerConfigFile(model, path, FACES_CONFIG_DATA);
> 	}
>
> @@ -55,7 +55,7 @@
> 		return isConfigFileRegistered(model, path, FACES_CONFIG_DATA);
> 	}
> 	
> -	public static void unregisterFacesConfig(XModel model, String path) {
> +	public static void unregisterFacesConfig(XModel model, String path) throws XModelException {
> 		unregisterConfigFile(model, path, FACES_CONFIG_DATA);
> 	}
> 	
> @@ -67,7 +67,7 @@
> 		return WebAppHelper.findWebAppContextParam(webxml, name);
> 	}
> 	
> -	public static void registerFacesConfigRename(XModel model, String oldConfigName, String newConfigName, String path) {
> +	public static void registerFacesConfigRename(XModel model, String oldConfigName, String newConfigName, String path) throws XModelException {
> 		registerConfigFileRename(model, oldConfigName, newConfigName, path, FACES_CONFIG_DATA);
> 	}
> 	
> @@ -144,7 +144,7 @@
> 		}
> 	}
>
> -	public static void registerConfigFile(XModel model, String path, ConfigFilesData data) {
> +	public static void registerConfigFile(XModel model, String path, ConfigFilesData data) throws XModelException {
> 		XModelObject webxml = getWebConfig(model);
> 		if(webxml == null) return;
> 		XModelObject p = findInitParam(webxml, data.param);
> @@ -188,7 +188,7 @@
> 		return false;
> 	}
> 	
> -	public static void unregisterConfigFile(XModel model, String path, ConfigFilesData data) {
> +	public static void unregisterConfigFile(XModel model, String path, ConfigFilesData data) throws XModelException {
> 		XModelObject webxml = getWebConfig(model);
> 		if(webxml == null) return;
> 		XModelObject p = findInitParam(webxml, data.param);
> @@ -203,7 +203,7 @@
> 		model.changeObjectAttribute(p, PARAM_VALUE, sb.toString());
> 	}
>
> -	public static void registerConfigFileRename(XModel model, String oldConfigName, String newConfigName, String path, ConfigFilesData data) {
> +	public static void registerConfigFileRename(XModel model, String oldConfigName, String newConfigName, String path, ConfigFilesData data) throws XModelException {
> 		XModelObject webxml = getWebConfig(model);
> 		if(webxml == null || "yes".equals(webxml.get("isIncorrect"))) return;
> 		XModelObject p = findInitParam(webxml, data.param);
>
> _______________________________________________
> jbosstools-commits mailing list
> jbosstools-commits at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-commits
>
>
> 







More information about the jbosstools-dev mailing list