[119126] Ant - improve error handling and messages for invalid input.
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/selection/SelectionTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/selection/SelectionTransformer.java
index 932c8af..7daac8e 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/selection/SelectionTransformer.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/selection/SelectionTransformer.java
@@ -22,7 +22,10 @@
IStructuredSelection inSelection = (IStructuredSelection)value;
Selection outSelection = new Selection();
- outSelection.setSelection( inSelection.toArray() );
+ if (inSelection != null)
+ {
+ outSelection.setSelection( inSelection.toArray() );
+ }
return outSelection;
}
diff --git a/bundles/org.eclipse.jst.ws/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws/META-INF/MANIFEST.MF
index 4f72b06..e3b25c3 100644
--- a/bundles/org.eclipse.jst.ws/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.1.qualifier
Bundle-Activator: org.eclipse.jst.ws.internal.plugin.WebServicePlugin
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPlugin.properties b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPlugin.properties
index a159e14..97d4fc1 100644
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPlugin.properties
+++ b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPlugin.properties
@@ -17,3 +17,5 @@
ANY_FILTER_NAME=All files
ANY_FILTER_DESC=This is a kind of Filter that accepts all objects.
+
+ERROR_SELECTION_TRANSFORM=Specified selection does not match a resource.
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPluginMessages.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPluginMessages.java
index 018b749..9cffbd3 100644
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPluginMessages.java
+++ b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/WSPluginMessages.java
@@ -23,6 +23,7 @@
public static String MSG_ERROR_SERVER;
public static String ANY_FILTER_NAME;
public static String ANY_FILTER_DESC;
+ public static String ERROR_SELECTION_TRANSFORM;
static {
NLS.initializeMessages(BUNDLE_NAME, WSPluginMessages.class);
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/String2SelectionTransformer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/String2SelectionTransformer.java
index 15c87ef..2e0ef4b 100644
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/String2SelectionTransformer.java
+++ b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/String2SelectionTransformer.java
@@ -20,6 +20,7 @@
import org.eclipse.jst.j2ee.ejb.EJBResource;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.componentcore.util.EJBArtifactEdit;
+import org.eclipse.jst.ws.internal.WSPluginMessages;
import org.eclipse.wst.command.internal.env.common.FileResourceUtils;
import org.eclipse.wst.command.internal.env.core.data.Transformer;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -37,47 +38,50 @@
StructuredSelection selection = null;
IResource resource = FileResourceUtils.getWorkspaceRoot().findMember(new Path(value.toString()));
- IProject resProject = resource.getProject();
-
- // check if resource is part of an EJB
- if (J2EEUtils.isEJBComponent(resProject))
- {
- // if resource is part of EJB need to get the EnterpriseBean as the selection
- IVirtualComponent[] ejbComponents = J2EEUtils.getEJBComponents(resProject);
- EJBArtifactEdit ejbEdit = null;
- try{
- ejbEdit = EJBArtifactEdit.getEJBArtifactEditForRead(ejbComponents[0]);
- EJBResource ejbRes = ejbEdit.getEJBJarXmiResource();
- EJBJar ejbJar = ejbRes.getEJBJar();
- IPath path = resource.getFullPath();
- String resourcePath = ResourceUtils.getJavaResourcePackageName(path);
- String javaClassName = resource.getName();
- // strip off file extension if necessary
- if (javaClassName.lastIndexOf('.')>-1)
- {
- javaClassName = javaClassName.substring(0, javaClassName.lastIndexOf('.'));
- }
- JavaClass javaClass = JavaMOFUtils.getJavaClass(resourcePath, javaClassName, resProject);
- EnterpriseBean ejb = ejbJar.getEnterpriseBeanWithReference(javaClass);
- if (ejb != null)
- {
- selection = new StructuredSelection(ejb.getName());
- }
- }
- catch (Exception exc)
- {
-
- }
- finally {
- if (ejbEdit!=null)
- ejbEdit.dispose();
- }
- }
-
if (resource != null)
{
+ IProject resProject = resource.getProject();
+ // check if resource is part of an EJB
+ if (J2EEUtils.isEJBComponent(resProject))
+ {
+ // if resource is part of EJB need to get the EnterpriseBean as the selection
+ IVirtualComponent[] ejbComponents = J2EEUtils.getEJBComponents(resProject);
+ EJBArtifactEdit ejbEdit = null;
+ try{
+ ejbEdit = EJBArtifactEdit.getEJBArtifactEditForRead(ejbComponents[0]);
+ EJBResource ejbRes = ejbEdit.getEJBJarXmiResource();
+ EJBJar ejbJar = ejbRes.getEJBJar();
+ IPath path = resource.getFullPath();
+ String resourcePath = ResourceUtils.getJavaResourcePackageName(path);
+ String javaClassName = resource.getName();
+ // strip off file extension if necessary
+ if (javaClassName.lastIndexOf('.')>-1)
+ {
+ javaClassName = javaClassName.substring(0, javaClassName.lastIndexOf('.'));
+ }
+ JavaClass javaClass = JavaMOFUtils.getJavaClass(resourcePath, javaClassName, resProject);
+ EnterpriseBean ejb = ejbJar.getEnterpriseBeanWithReference(javaClass);
+ if (ejb != null)
+ {
+ selection = new StructuredSelection(ejb.getName());
+ }
+ }
+ catch (Exception exc)
+ {
+
+ }
+ finally {
+ if (ejbEdit!=null)
+ ejbEdit.dispose();
+ }
+ }
selection = new StructuredSelection(resource);
- }
+ }
+ else
+ {
+ // string doesn't return resource - error condition
+ throw new IllegalArgumentException(WSPluginMessages.ERROR_SELECTION_TRANSFORM);
+ }
return selection;
}
diff --git a/bundles/org.eclipse.wst.command.env.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.command.env.core/META-INF/MANIFEST.MF
index 1c1522f..b224dbc 100644
--- a/bundles/org.eclipse.wst.command.env.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.command.env.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.wst.command.env.core
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.1.qualifier
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
Export-Package: org.eclipse.wst.command.internal.env.core.data,
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/fragment/CommandFragmentEngine.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/fragment/CommandFragmentEngine.java
index 2a68f63..4b98c58 100644
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/fragment/CommandFragmentEngine.java
+++ b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/fragment/CommandFragmentEngine.java
@@ -357,8 +357,9 @@
}
// Subclasses can do initialization before the execution of a command here
- protected void initBeforeExecute( AbstractDataModelOperation operation )
+ protected IStatus initBeforeExecute( AbstractDataModelOperation operation )
{
+ return Status.OK_STATUS;
}
private IStatus runCommand( CommandListEntry entry, IProgressMonitor monitor )
@@ -378,7 +379,7 @@
try
{
- initBeforeExecute( cmd );
+ status = initBeforeExecute( cmd );
environment_.getLog().log(ILog.INFO, "command", 5001, this, "runCommand", "Executing: " + cmd.getClass().getName());
@@ -393,6 +394,7 @@
MultiStatus parentStatus = new MultiStatus( "id", 0, new IStatus[]{unexpectedError},
EnvironmentCoreMessages.MSG_ERROR_UNEXPECTED_ERROR, null );
environment_.getStatusHandler().reportError( parentStatus );
+ status = unexpectedError;
}
finally
{
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/Environment.properties b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/Environment.properties
index 41aa0a9..adfb459 100644
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/Environment.properties
+++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/Environment.properties
@@ -27,6 +27,7 @@
MSG_ERR_ANT_DATA_TRANSFORM=Exception transforming Ant property key {0} using transformation {1}.
MSG_ERR_ANT_CALL_SETTER=Exception invoking setter method {0} for Ant property.
MSG_ERR_ANT_CMD_FRAGMENT=Exception retrieving Ant command fragment from registry.
+MSG_ERR_ANT_SCENARIO_TYPE=Cannot determine scenario type. Please ensure scenarioType Ant property is set.
LABEL_YES=Yes
LABEL_YES_TO_ALL=Yes All
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/EnvironmentMessages.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/EnvironmentMessages.java
index 717a53d..7025e31 100644
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/EnvironmentMessages.java
+++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/EnvironmentMessages.java
@@ -35,6 +35,7 @@
public static String MSG_ERR_ANT_DATA_TRANSFORM;
public static String MSG_ERR_ANT_CALL_SETTER;
public static String MSG_ERR_ANT_CMD_FRAGMENT;
+ public static String MSG_ERR_ANT_SCENARIO_TYPE;
public static String LABEL_YES;
public static String LABEL_YES_TO_ALL;
public static String LABEL_CANCEL;
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntController.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntController.java
index 65a21b4..4080a0f 100644
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntController.java
+++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntController.java
@@ -13,7 +13,10 @@
import java.util.Hashtable;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.command.internal.env.EnvironmentMessages;
import org.eclipse.wst.command.internal.env.context.PersistentResourceContext;
import org.eclipse.wst.command.internal.env.core.CommandManager;
import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
@@ -49,14 +52,23 @@
// set up operation fragments - conditional on options by user... service or client
// also need to initialize the "selection" or input file (WSDL, Java) here
+
CommandFragment rootFragment = environment.getRootCommandFragment();
- // construct the engine - manages execution of operations
- createOperationManager(rootFragment, dataManager, environment);
-
- DataMappingRegistryImpl dataRegistry_ = new DataMappingRegistryImpl();
- rootFragment.registerDataMappings(dataRegistry_);
-
+ if (rootFragment != null)
+ {
+ //construct the engine - manages execution of operations
+ createOperationManager(rootFragment, dataManager, environment);
+
+ DataMappingRegistryImpl dataRegistry_ = new DataMappingRegistryImpl();
+ rootFragment.registerDataMappings(dataRegistry_);
+ }
+ else //problem getting the root fragment - scenario type is likely missing
+ {
+ handler.reportError(new Status(IStatus.ERROR, "ws_ant", 9999, EnvironmentMessages.MSG_ERR_ANT_SCENARIO_TYPE, null));
+ return;
+ }
+
//ready to start running operations
((AntOperationManager)getOperationManager()).moveForwardToNextStop(new NullProgressMonitor());
}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java
index bbeaf48..d65dbc9 100644
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java
+++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntEnvironment.java
@@ -10,22 +10,30 @@
*******************************************************************************/
package org.eclipse.wst.command.internal.env.ant;
-import java.lang.reflect.*;
-import java.util.*;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.command.internal.env.EnvironmentMessages;
-import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment;
import org.eclipse.wst.command.internal.env.core.CommandManager;
import org.eclipse.wst.command.internal.env.core.context.ResourceContext;
import org.eclipse.wst.command.internal.env.core.data.BeanModifier;
import org.eclipse.wst.command.internal.env.core.data.ClassEntry;
import org.eclipse.wst.command.internal.env.core.data.Transformer;
+import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment;
+import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment;
import org.eclipse.wst.common.environment.ILog;
import org.eclipse.wst.common.environment.IStatusHandler;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -46,9 +54,6 @@
private boolean mappingComplete_;
private ClassEntry classEntry;
- public static int INIT_OPERATION_DATA_SUCCESS = 1;
- public static int INIT_OPERATION_DATA_FAIL = -1;
-
// extensionPoint names and namespace
private static String MAPPER_EXT_PT = "antDataMapping"; //$NON-NLS-1$
private static String SCENARIO_EXT_PT = "antScenario"; //$NON-NLS-1$
@@ -83,15 +88,15 @@
}
// call from engine prior to executing the operation
- public int initOperationData(AbstractDataModelOperation op)
+ public IStatus initOperationData(AbstractDataModelOperation op)
{
//check to see if data has already been primed for this operation
String qualifiedClassName = op.getClass().getName();
if (operationDataRecord_.get(qualifiedClassName) == null)
{
classEntry = new ClassEntry();
- try {
+ try {
//extension lookup for the bean - may be more than one property for it
Enumeration operationData = getMappingExtensions(op);
classEntry.setterList_= getSetterList(op);
@@ -133,13 +138,12 @@
operationDataRecord_.put(qualifiedClassName, "");
}
catch (Exception e)
- {
- e.printStackTrace();
- return INIT_OPERATION_DATA_FAIL;
+ {
+ throw new IllegalArgumentException(e.getMessage());
}
}
- return INIT_OPERATION_DATA_SUCCESS;
+ return Status.OK_STATUS;
}
/**
@@ -171,7 +175,7 @@
* @param operationName The name of the operation that is being initialized.
* @return A collection of PropertyDataHolder objects. Returns null if there are no extensions matching the operationName.
*/
- private Enumeration getMappingExtensions(AbstractDataModelOperation operation)
+ private Enumeration getMappingExtensions(AbstractDataModelOperation operation) throws CoreException
{
String operationName = operation.getClass().getName();
//go to ext registry and get all antMapping extensions
@@ -203,7 +207,10 @@
transform = ce.createExecutableExtension(MAPPER_TRANSFORM_ATTRIBUTE);
}
catch (CoreException cex) {
- getLog().log(ILog.ERROR, "ws_ant", 5092, this, "getMappingExtensions", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_DATA_TRANSFORM, key, transform));
+ Status errorStatus = new Status(Status.ERROR, "ws_ant", 5092, cex.getMessage(), cex);
+ getStatusHandler().reportError(errorStatus);
+ getLog().log(ILog.ERROR, "ws_ant", 5092, this, "getMappingExtensions", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_DATA_TRANSFORM, key, transform));
+ throw new CoreException(errorStatus);
}
if (transform != null && transform instanceof BeanModifier/*dataTable.containsKey(property)*/)
@@ -271,8 +278,9 @@
}
catch (Exception exc)
{
- getLog().log(ILog.ERROR, "ws_ant", 5093, this, "transformAndSet", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_DATA_TRANSFORM, mapping.key_, mapping.transform_));
- return false;
+ getStatusHandler().reportError(new Status(Status.ERROR, "ws_ant", 5093, exc.getMessage(), exc));
+ getLog().log(ILog.ERROR, "ws_ant", 5093, this, "transformAndSet", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_DATA_TRANSFORM, mapping.key_, mapping.transform_));
+ throw new IllegalArgumentException(exc.getMessage());
}
}
return false;
@@ -347,7 +355,7 @@
return result;
}
- private boolean callSetter(AbstractDataModelOperation op, Object param, String setterMethodName)
+ private boolean callSetter(AbstractDataModelOperation op, Object param, String setterMethodName) throws CoreException
{
for (Iterator iterator = classEntry.setterList_.iterator(); iterator.hasNext();)
{
@@ -362,7 +370,10 @@
return true;
}
catch(Exception cex){
+ Status errorStatus = new Status(Status.ERROR, "ws_ant", 5094, cex.getMessage(), cex);
+ getStatusHandler().reportError(errorStatus);
getLog().log(ILog.ERROR, "ws_ant", 5094, this, "callSetter", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_CALL_SETTER, setterMethodName));
+ throw new CoreException(errorStatus);
}
}
}
@@ -372,7 +383,7 @@
// look for setter with primitive type parameter - if find one, convert String propertyValue and call it
- private boolean callPrimitiveSetter(PropertyDataHolder mapping)
+ private boolean callPrimitiveSetter(PropertyDataHolder mapping) throws CoreException
{
for (Iterator iterator = classEntry.setterList_.iterator(); iterator.hasNext();) {
Method element = (Method) iterator.next();
@@ -422,7 +433,10 @@
return true;
}
catch(Exception e){
+ Status errorStatus = new Status(Status.ERROR, "ws_ant", 5095, e.getMessage(), e);
+ getStatusHandler().reportError(errorStatus);
getLog().log(ILog.ERROR, "ws_ant", 5095, this, "callPrimitiveSetter", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_CALL_SETTER, element.getName()));
+ throw new CoreException(errorStatus);
}
}
}
@@ -432,7 +446,7 @@
//check for setter with parameter type that takes a String to construct
// construct the parameter using String & call the setter
- private boolean callSetterConstructor(PropertyDataHolder mapping)
+ private boolean callSetterConstructor(PropertyDataHolder mapping) throws CoreException
{
for (Iterator iterator = classEntry.setterList_.iterator(); iterator.hasNext();) {
Method element = (Method) iterator.next();
@@ -448,8 +462,10 @@
}
catch (Exception exc)
{
+ Status errorStatus = new Status(Status.ERROR, "ws_ant", 5096, exc.getMessage(), exc);
+ getStatusHandler().reportError(errorStatus);
getLog().log(ILog.ERROR, "ws_ant", 5096, this, "callSetterConstructor", EnvironmentMessages.bind(EnvironmentMessages.MSG_ERR_ANT_CALL_SETTER, element.getName()));
- return false;
+ throw new CoreException(errorStatus);
}
}
}
@@ -463,7 +479,7 @@
return controller_.getOperationManager();
}
- public CommandFragment getRootCommandFragment()
+ public CommandFragment getRootCommandFragment()
{
//look up the commandFragment in the scenarioRegistry extension point with an ID corresponding to the scenario property in the propertytable
@@ -489,6 +505,8 @@
}
catch (Exception exception)
{
+ Status errorStatus = new Status(Status.ERROR, "ws_ant", 5097, exception.getMessage(), exception);
+ getStatusHandler().reportError(errorStatus);
getLog().log(ILog.ERROR, "ws_ant", 5097, this, "getRootCommandFragment", EnvironmentMessages.MSG_ERR_ANT_CMD_FRAGMENT);
}
}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntOperationManager.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntOperationManager.java
index f8eaddc..1898612 100644
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntOperationManager.java
+++ b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/ant/AntOperationManager.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.wst.command.internal.env.ant;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment;
import org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine;
@@ -27,14 +29,19 @@
{
private AntEnvironment environment_;
- protected void initBeforeExecute( AbstractDataModelOperation operation )
- {
- int initStatus = environment_.initOperationData( operation );
-
- if (initStatus == AntEnvironment.INIT_OPERATION_DATA_FAIL)
+ protected IStatus initBeforeExecute( AbstractDataModelOperation operation )
+ {
+ environment_.getLog().log(ILog.INFO, "ws_ant", 5098, this, "initBeforeExecute", "Initializing data for: " + operation.getClass().getName());
+ IStatus initStatus = Status.OK_STATUS;
+ try
{
- environment_.getLog().log(ILog.INFO, "ws_ant", 5098, this, "runCommand", "Initializing data for: " + operation.getClass().getName());
+ initStatus = environment_.initOperationData( operation );
}
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ return initStatus;
}
/**