Merge branch 'hhoyos/executors' into hhoyos/iEvlExperiments
diff --git a/plugins/org.eclipse.epsilon.common.dt/src/org/eclipse/epsilon/common/dt/editor/AbstractModuleEditor.java b/plugins/org.eclipse.epsilon.common.dt/src/org/eclipse/epsilon/common/dt/editor/AbstractModuleEditor.java
index cb32df0..99adacc 100644
--- a/plugins/org.eclipse.epsilon.common.dt/src/org/eclipse/epsilon/common/dt/editor/AbstractModuleEditor.java
+++ b/plugins/org.eclipse.epsilon.common.dt/src/org/eclipse/epsilon/common/dt/editor/AbstractModuleEditor.java
@@ -489,7 +489,6 @@
@Override
public void doSave(IProgressMonitor progressMonitor) {
- // TODO Auto-generated method stub
super.doSave(progressMonitor);
if (!supportsDirtyTextParsing()) parseModule();
}
@@ -535,13 +534,11 @@
@Override
public Enumeration<String> getKeys() {
- // TODO Auto-generated method stub
return null;
}
@Override
protected Object handleGetObject(String key) {
- // TODO Auto-generated method stub
return null;
}},
"ContentAssistProposal", this, SourceViewer.CONTENTASSIST_PROPOSALS);
diff --git a/plugins/org.eclipse.epsilon.emc.csv.dt/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.emc.csv.dt/META-INF/MANIFEST.MF
index 634fbb1..68585f4 100644
--- a/plugins/org.eclipse.epsilon.emc.csv.dt/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.epsilon.emc.csv.dt/META-INF/MANIFEST.MF
@@ -6,5 +6,5 @@
Export-Package: org.eclipse.epsilon.emc.csv.dt
Bundle-Vendor: Eclipse Modeling Project
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: org.eclipse.epsilon.emc.csv,
- org.eclipse.epsilon.common.dt
+Require-Bundle: org.eclipse.epsilon.common.dt,
+ org.eclipse.epsilon.emc.csv;bundle-version="1.5.0"
diff --git a/plugins/org.eclipse.epsilon.emc.csv/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.emc.csv/META-INF/MANIFEST.MF
index d9246b1..cb8ad0d 100644
--- a/plugins/org.eclipse.epsilon.emc.csv/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.epsilon.emc.csv/META-INF/MANIFEST.MF
@@ -6,5 +6,6 @@
Bundle-Vendor: Eclipse Modeling Project
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.epsilon.eol.engine,
+ org.slf4j.api;bundle-version="1.7.10",
org.apache.commons.csv_1.5;bundle-version="1.5.0"
Export-Package: org.eclipse.epsilon.emc.csv
diff --git a/plugins/org.eclipse.epsilon.emc.csv/src/org/eclipse/epsilon/emc/csv/CsvModel.java b/plugins/org.eclipse.epsilon.emc.csv/src/org/eclipse/epsilon/emc/csv/CsvModel.java
index 3977ce1..e1fddeb 100644
--- a/plugins/org.eclipse.epsilon.emc.csv/src/org/eclipse/epsilon/emc/csv/CsvModel.java
+++ b/plugins/org.eclipse.epsilon.emc.csv/src/org/eclipse/epsilon/emc/csv/CsvModel.java
@@ -44,29 +44,32 @@
/**
* The Class CsvModel provides The Epsilon Model Connectivity Layer for CSV
- * files (http://tools.ietf.org/html/rfc4180), with the difference that it
+ * files (http://tools.ietf.org/html/rfc4180), with the difference that it
* supports files in which each line has a different number of fields.
* <p>
* Three properties allow configuration of how to read the CSV file:
* <ul>
- * <li>PROPERTY_FIELD_SEPARATOR, by default a comma (','), but you can specify
- * a different separator. In particular, fields are identified using
- * {@link java.lang.String#split(String)}, and as such, PROPERTY_FIELD_SEPARATOR is
- * actually treated as regular expression (see <a href="Regex>http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sum)</a>
- * <li>PROPERTY_HAS_KNOWN_HEADERS, "There maybe an optional header line appearing
- * as the first line of the file with the same format as normal record lines. This
- * header will contain names corresponding to the fields in the file and should
- * contain the same number of fields as the records in the rest of the file". If
- * this property is set to true, model loading will verify that all lines have the
- * same number of fields as the header. When accessing the model elements (rows)
- * each of the header fields can be used to access information on each record.
+ * <li>PROPERTY_FIELD_SEPARATOR, by default a comma (','), but you can specify a
+ * different separator. In particular, fields are identified using
+ * {@link java.lang.String#split(String)}, and as such, PROPERTY_FIELD_SEPARATOR
+ * is actually treated as regular expression (see <a
+ * href="Regex>http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sum)</a>
+ * <li>PROPERTY_HAS_KNOWN_HEADERS, "There maybe an optional header line
+ * appearing as the first line of the file with the same format as normal record
+ * lines. This header will contain names corresponding to the fields in the file
+ * and should contain the same number of fields as the records in the rest of
+ * the file". If this property is set to true, model loading will verify that
+ * all lines have the same number of fields as the header. When accessing the
+ * model elements (rows) each of the header fields can be used to access
+ * information on each record.
* <li>PROPERTY_HAS_VARARGS_HEADERS, allows the use of varargs headers. This is
* a special type of header in which the last filed in the header line is used
* as a base name for all fields after this one. This allows for lines to have a
* variable number of fields. During model loading it will be verified that each
- * line has at least the same number of fields as header fields minus one. Fields
- * in a record including and following the last header filed will be assigned the
- * header lastHeader0, lastHeader1, lastHeader2,... and so on an so forth.
+ * line has at least the same number of fields as header fields minus one.
+ * Fields in a record including and following the last header filed will be
+ * assigned the header lastHeader0, lastHeader1, lastHeader2,... and so on an so
+ * forth.
* </ul>
*
*
@@ -83,44 +86,44 @@
/** The Constant PROPERTY_HAS_KNOWN_HEADERS. */
public static final String PROPERTY_HAS_KNOWN_HEADERS = "hasKnownHeaders";
-
+
/** The Constant PROPERTY_HAS_VARARGS_HEADERS. */
public static final String PROPERTY_HAS_VARARGS_HEADERS = "hasVarargsHeaders";
public static final String PROPERTY_FILE_ENCODING = "fileEncoding";
public static final String PROPERTY_QUOTE_CHARACTER = "quoteCharacter";
-
+
public static final String PROPERTY_ID_FIELD = "idField";
-
+
/** The field separator. */
protected char fieldSeparator = ',';
-
+
/** The quote char. */
protected char quoteChar = '"';
-
+
/** The has known headers. */
protected boolean knownHeaders;
-
+
/** The has varargs headers. */
protected boolean varargsHeaders;
-
+
/** The field that can be used as id */
- protected String idFieldName = ""; // When using header
- protected int idFieldIndex = -1; // For no header
-
+ protected String idFieldName = ""; // When using header
+ protected int idFieldIndex = -1; // For no header
+
/** The file path. */
protected String file;
-
+
/* Objects in this model are Maps */
/** The rows. */
protected List<Map<String, Object>> rows;
-
+
/** The file reader */
private BufferedReader reader;
protected Charset cs;
-
+
/**
* Gets the field separator.
*
@@ -174,7 +177,6 @@
public void setVarargsHeaders(boolean varargsHeaders) {
this.varargsHeaders = varargsHeaders;
}
-
/**
* @return the id Field Name
@@ -204,15 +206,21 @@
this.idFieldIndex = idFieldIndex;
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.IModel#getEnumerationValue(java.lang.String, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.epsilon.eol.models.IModel#getEnumerationValue(java.lang.String,
+ * java.lang.String)
*/
@Override
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException {
throw new UnsupportedOperationException("CSV Models don't support enumerations.");
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.Model#getTypeOf(java.lang.Object)
*/
@Override
@@ -223,7 +231,9 @@
return LinkedHashMap.class;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#getTypeNameOf(java.lang.Object)
*/
@Override
@@ -231,10 +241,12 @@
if (!isModelElement(instance)) {
throw new IllegalArgumentException("Not a valid CSV model instance");
}
- return LinkedHashMap.class.getName();
+ return "Row";
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#getElementById(java.lang.String)
*/
@Override
@@ -249,8 +261,7 @@
return row;
}
}
- }
- else {
+ } else {
for (Map<String, Object> row : rows) {
List<Object> fields = (List<Object>) row.get(HEADERLESS_FIELD_NAME);
if (fields.get(idFieldIndex).equals(id)) {
@@ -262,7 +273,9 @@
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#getElementId(java.lang.Object)
*/
@SuppressWarnings("unchecked")
@@ -275,15 +288,17 @@
Map<String, Object> row = (Map<String, Object>) instance;
if (!idFieldName.isEmpty()) {
return (String) row.get(idFieldName);
- }
- else {
+ } else {
List<Object> fields = (List<Object>) row.get(HEADERLESS_FIELD_NAME);
return (String) fields.get(idFieldIndex);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.IModel#setElementId(java.lang.Object, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.epsilon.eol.models.IModel#setElementId(java.lang.Object,
+ * java.lang.String)
*/
@SuppressWarnings("unchecked")
@Override
@@ -295,14 +310,15 @@
Map<String, Object> row = (Map<String, Object>) instance;
if (!idFieldName.isEmpty()) {
row.put(idFieldName, newId);
- }
- else {
+ } else {
List<Object> fields = (List<Object>) row.get(HEADERLESS_FIELD_NAME);
fields.set(idFieldIndex, newId);
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#owns(java.lang.Object)
*/
@Override
@@ -310,7 +326,9 @@
return rows.contains(instance);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#isInstantiable(java.lang.String)
*/
@Override
@@ -318,7 +336,9 @@
return hasType(type);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.Model#isModelElement(java.lang.Object)
*/
@Override
@@ -326,7 +346,9 @@
return (instance instanceof LinkedHashMap) && rows.contains(instance);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#hasType(java.lang.String)
*/
@Override
@@ -334,7 +356,9 @@
return "Row".equals(type);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#store(java.lang.String)
*/
@Override
@@ -348,12 +372,14 @@
return true;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.IModel#store()
*/
@Override
public boolean store() {
-
+
try {
FileUtil.setFileContents(concatenateMap(), new File(this.file));
} catch (Exception e) {
@@ -362,12 +388,13 @@
}
return true;
}
-
+
private String concatenateMap() {
StringBuilder output = new StringBuilder();
if (this.knownHeaders) {
// First line is the headers
- Iterator<String> keyIt = ((Map<String, Object>) ((LinkedList<Map<String, Object>>) rows).getFirst()).keySet().iterator();
+ Iterator<String> keyIt = ((Map<String, Object>) ((LinkedList<Map<String, Object>>) rows).getFirst())
+ .keySet().iterator();
output.append(keyIt.next());
while (keyIt.hasNext()) {
output.append(this.fieldSeparator);
@@ -375,7 +402,7 @@
}
output.append(System.getProperty("line.separator"));
}
- for (Map<String, Object>row : rows) {
+ for (Map<String, Object> row : rows) {
Iterator<Object> fieldIt = row.values().iterator();
output.append(fieldIt.next());
while (fieldIt.hasNext()) {
@@ -383,12 +410,14 @@
output.append(fieldIt.next());
}
output.append(System.getProperty("line.separator"));
-
+
}
return output.toString();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.CachedModel#allContentsFromModel()
*/
@Override
@@ -396,33 +425,48 @@
return rows;
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#getAllOfTypeFromModel(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.epsilon.eol.models.CachedModel#getAllOfTypeFromModel(java.lang.
+ * String)
*/
@Override
- protected Collection<Map<String, Object>> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException {
+ protected Collection<Map<String, Object>> getAllOfTypeFromModel(String type)
+ throws EolModelElementTypeNotFoundException {
if (!"Row".equals(type)) {
throw new EolModelElementTypeNotFoundException(this.name, type);
}
return allContents();
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#getAllOfKindFromModel(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.epsilon.eol.models.CachedModel#getAllOfKindFromModel(java.lang.
+ * String)
*/
@Override
- protected Collection<Map<String, Object>> getAllOfKindFromModel(String kind) throws EolModelElementTypeNotFoundException {
+ protected Collection<Map<String, Object>> getAllOfKindFromModel(String kind)
+ throws EolModelElementTypeNotFoundException {
if (!"Row".equals(kind)) {
throw new EolModelElementTypeNotFoundException(this.name, kind);
}
return allContents();
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#createInstanceInModel(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.epsilon.eol.models.CachedModel#createInstanceInModel(java.lang.
+ * String)
*/
@Override
- protected Map<String, Object> createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException {
+ protected Map<String, Object> createInstanceInModel(String type)
+ throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException {
if (!"Row".equals(type)) {
throw new EolModelElementTypeNotFoundException(this.name, type);
}
@@ -433,12 +477,12 @@
rows.add(returnVal);
return returnVal;
}
-
+
@Override
public IPropertyGetter getPropertyGetter() {
return new CsvPropertyGetter();
}
-
+
@Override
public IReflectivePropertySetter getPropertySetter() {
return new CsvPropertySetter();
@@ -448,10 +492,12 @@
* Checks if the model elements have this property.
*
*
- * @param type the type (should always be "Row" (see {@link #hasType(String)} )
+ * @param type the type (should always be "Row" (see
+ * {@link #hasType(String)} )
* @param property the property
* @return true, if successful
- * @throws EolModelElementTypeNotFoundException the eol model element type not found exception
+ * @throws EolModelElementTypeNotFoundException the eol model element type not
+ * found exception
*/
public boolean hasProperty(String type, String property) throws EolModelElementTypeNotFoundException {
if (!hasType(type)) {
@@ -460,7 +506,8 @@
if (!this.knownHeaders) {
return property.equals(HEADERLESS_FIELD_NAME);
} else {
- return ((LinkedHashMap<String, Object>) ((LinkedList<Map<String, Object>>) rows).getFirst()).keySet().contains(property);
+ return ((LinkedHashMap<String, Object>) ((LinkedList<Map<String, Object>>) rows).getFirst()).keySet()
+ .contains(property);
}
}
@@ -474,22 +521,22 @@
}
/**
- * @param rows
- * @param reader
- * @param varargsHeaders
- * @param fieldSeparator
- * @param knownHeaders
+ * @param rows
+ * @param reader
+ * @param varargsHeaders
+ * @param fieldSeparator
+ * @param knownHeaders
* @throws EolModelLoadingException
*/
- protected static List<Map<String, Object>> createRows(BufferedReader reader,
- boolean knownHeaders, char fieldSeparator, boolean varargsHeaders) throws Exception {
-
+ protected static List<Map<String, Object>> createRows(BufferedReader reader, boolean knownHeaders,
+ char fieldSeparator, boolean varargsHeaders) throws Exception {
+
List<Map<String, Object>> rows = new LinkedList<Map<String, Object>>();
-
+
Iterable<CSVRecord> records;
try {
CSVFormat csvFormat = CSVFormat.RFC4180.withDelimiter(fieldSeparator);
- if(knownHeaders) {
+ if (knownHeaders) {
csvFormat = csvFormat.withFirstRecordAsHeader();
records = csvFormat.parse(reader);
for (CSVRecord record : records) {
@@ -499,20 +546,20 @@
row.put(entry.getKey(), entry.getValue());
}
} else {
- Map<String, Integer> hm = ((CSVParser)records).getHeaderMap();
+ Map<String, Integer> hm = ((CSVParser) records).getHeaderMap();
Set<String> hmKeys = hm.keySet();
Iterator<String> hmKeysIT = hmKeys.iterator();
Iterator<String> it = record.iterator();
int i = 0;
- int normalFields = hmKeys.size()-1;
- while(it.hasNext() && (i < normalFields)) {
+ int normalFields = hmKeys.size() - 1;
+ while (it.hasNext() && (i < normalFields)) {
String value = it.next();
row.put(hmKeysIT.next(), value);
i++;
}
List<String> varargsField = new ArrayList<String>();
- while(it.hasNext()) {
- varargsField.add(it.next());
+ while (it.hasNext()) {
+ varargsField.add(it.next());
}
row.put(hmKeysIT.next(), varargsField);
}
@@ -532,35 +579,41 @@
throw new IllegalStateException("Error reading the CSV file");
} finally {
if (reader != null) {
- try { reader.close(); } catch (IOException e) { }
+ try {
+ reader.close();
+ } catch (IOException e) {
+ }
}
}
return rows;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#load(org.eclipse.epsilon.common.util.StringProperties, java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.epsilon.eol.models.CachedModel#load(org.eclipse.epsilon.common.
+ * util.StringProperties, java.lang.String)
*/
@Override
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException {
super.load(properties, resolver);
-
- file = resolver.resolve(properties.getProperty(PROPERTY_FILE));
- fieldSeparator = properties.getProperty(PROPERTY_FIELD_SEPARATOR, ",").charAt(0);
- quoteChar = properties.getProperty(PROPERTY_QUOTE_CHARACTER, "\"").charAt(0);
- knownHeaders = properties.getBooleanProperty(PROPERTY_HAS_KNOWN_HEADERS, true);
- varargsHeaders = properties.getBooleanProperty(PROPERTY_HAS_VARARGS_HEADERS, false);
- if (knownHeaders) {
- idFieldName = properties.getProperty(PROPERTY_ID_FIELD, "");
- }
- else {
-
- int integerProperty = properties.getIntegerProperty(PROPERTY_ID_FIELD, -1);
- if (integerProperty >= 0) {
- idFieldIndex = integerProperty;
- }
- }
- cs = Charset.forName((String) properties.getOrDefault(PROPERTY_FILE_ENCODING, "UTF-8"));
+
+ file = resolver.resolve(properties.getProperty(PROPERTY_FILE));
+ fieldSeparator = properties.getProperty(PROPERTY_FIELD_SEPARATOR, ",").charAt(0);
+ quoteChar = properties.getProperty(PROPERTY_QUOTE_CHARACTER, "\"").charAt(0);
+ knownHeaders = properties.getBooleanProperty(PROPERTY_HAS_KNOWN_HEADERS, true);
+ varargsHeaders = properties.getBooleanProperty(PROPERTY_HAS_VARARGS_HEADERS, false);
+ if (knownHeaders) {
+ idFieldName = properties.getProperty(PROPERTY_ID_FIELD, "");
+ } else {
+
+ int integerProperty = properties.getIntegerProperty(PROPERTY_ID_FIELD, -1);
+ if (integerProperty >= 0) {
+ idFieldIndex = integerProperty;
+ }
+ }
+ cs = Charset.forName((String) properties.getOrDefault(PROPERTY_FILE_ENCODING, "UTF-8"));
try {
setReader(Files.newBufferedReader(Paths.get(this.file), cs));
} catch (IOException e) {
@@ -569,7 +622,9 @@
load();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.epsilon.eol.models.CachedModel#disposeModel()
*/
@Override
@@ -577,33 +632,43 @@
rows.clear();
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#deleteElementInModel(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.epsilon.eol.models.CachedModel#deleteElementInModel(java.lang.
+ * Object)
*/
@Override
protected boolean deleteElementInModel(Object instance) throws EolRuntimeException {
return rows.remove(instance);
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#getCacheKeyForType(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.epsilon.eol.models.CachedModel#getCacheKeyForType(java.lang.
+ * String)
*/
@Override
protected Object getCacheKeyForType(String type) throws EolModelElementTypeNotFoundException {
return type;
}
- /* (non-Javadoc)
- * @see org.eclipse.epsilon.eol.models.CachedModel#getAllTypeNamesOf(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.epsilon.eol.models.CachedModel#getAllTypeNamesOf(java.lang.
+ * Object)
*/
@Override
- protected Collection<String> getAllTypeNamesOf(Object instance) {
+ protected Set<String> getAllTypeNamesOf(Object instance) {
if (!isModelElement(instance)) {
throw new IllegalArgumentException("Not a valid CSV model instance");
}
return Collections.singleton("Row");
}
-
+
/**
* Assign the reader used by the model.
*
diff --git a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/ExecutableBlock.java b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/ExecutableBlock.java
index a39c389..8eafa32 100644
--- a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/ExecutableBlock.java
+++ b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/ExecutableBlock.java
@@ -143,15 +143,14 @@
else if (expResClass != Void.class) {
throw new EolNoReturnException(expResClass.getSimpleName(), this, context);
}
-
- postExecution();
+ postExecution(retVal);
return retVal;
}
/**
* Any chores to be done after execution
*/
- protected void postExecution() {
+ public void postExecution(T retVal) {
}
diff --git a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/NameExpression.java b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/NameExpression.java
index 2c1c0b8..302146b 100644
--- a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/NameExpression.java
+++ b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/NameExpression.java
@@ -24,22 +24,23 @@
import org.eclipse.epsilon.eol.types.EolType;
public class NameExpression extends Expression {
-
+
protected String name;
protected boolean isTypeName = false;
-
- public NameExpression() {}
-
+
+ public NameExpression() {
+ }
+
public NameExpression(String name) {
this.name = name;
}
-
+
@Override
public void build(AST cst, IModule module) {
super.build(cst, module);
this.name = cst.getText();
}
-
+
public Object execute(IEolContext context, boolean returnVariable) throws EolRuntimeException {
FrameStack scope = context.getFrameStack();
Variable variable = scope.get(name);
@@ -47,7 +48,7 @@
if (variable != null && variable.getDeprecationInfo() != null) {
context.getWarningStream().println("Warning: " + variable.getDeprecationInfo().getMessage());
}
-
+
// First look for a model element type
// if the name contains a !
if (variable == null) {
@@ -55,12 +56,12 @@
variable = getModelElementType(name, context);
}
}
-
+
// Then look for a model with that name
if (variable == null) {
try {
IModel model = context.getModelRepository().getModelByName(name);
-
+
if (model != null)
variable = Variable.createReadOnlyVariable(name, model);
}
@@ -69,15 +70,15 @@
// variable in the scope
}
}
-
+
if (variable == null) {
try {
EolType type = (EolType) new TypeExpression(name).execute(context);
if (type != null) {
variable = Variable.createReadOnlyVariable(type.getName(), type);
}
+ } catch (EolTypeNotFoundException ex) {
}
- catch (EolTypeNotFoundException ex) {}
}
if (variable == null)
@@ -85,24 +86,22 @@
if (returnVariable) {
return variable;
- }
- else {
+ } else {
return variable.getValue();
}
}
-
+
@Override
public Object execute(IEolContext context) throws EolRuntimeException {
return execute(context, false);
}
-
+
@Override
public void compile(EolCompilationContext context) {
Variable variable = context.getFrameStack().get(name);
if (variable != null) {
resolvedType = variable.getType();
- }
- else {
+ } else {
EolModelElementType modelElementType = context.getModelElementType(name);
if (modelElementType != null) {
resolvedType = modelElementType;
@@ -110,13 +109,12 @@
if (modelElementType.getMetaClass() == null && !context.getModelDeclarations().isEmpty()) {
context.addErrorMarker(this, "Unknown type " + name);
}
- }
- else {
+ } else {
context.addErrorMarker(this, "Undefined variable or type " + name);
}
}
}
-
+
public Variable getModelElementType(String name, IEolContext context) {
try {
return Variable.createReadOnlyVariable(name, new EolModelElementType(name, context));
@@ -128,19 +126,19 @@
// proceed
}
}
-
+
public String getName() {
return name;
}
-
+
public void setName(String name) {
this.name = name;
}
-
+
public boolean isTypeName() {
return isTypeName;
}
-
+
public void setTypeName(boolean isTypeName) {
this.isTypeName = isTypeName;
}
diff --git a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/exceptions/models/EolModelNotFoundException.java b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/exceptions/models/EolModelNotFoundException.java
index 8e0c575..453bddd 100644
--- a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/exceptions/models/EolModelNotFoundException.java
+++ b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/exceptions/models/EolModelNotFoundException.java
@@ -11,7 +11,9 @@
import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
-public class EolModelNotFoundException extends EolRuntimeException{
+public class EolModelNotFoundException extends EolRuntimeException {
+
+ private static final long serialVersionUID = -5934264646760309137L;
private String modelName;
diff --git a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/execute/control/IExecutionListener.java b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/execute/control/IExecutionListener.java
index bd9d197..28f19f1 100644
--- a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/execute/control/IExecutionListener.java
+++ b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/execute/control/IExecutionListener.java
@@ -13,15 +13,39 @@
import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
import org.eclipse.epsilon.eol.execute.context.IEolContext;
+/**
+ * This IExecutionListener interface defines the methods required to get notifications abour the
+ * execution of AST elements of an Epsilon moudle.
+ *
+ * @author Dimitrios Kolovos
+ *
+ */
public interface IExecutionListener {
-
+
+ /**
+ * The AST is about to execute.
+ *
+ * @param ast the ast
+ * @param context the context
+ */
public void aboutToExecute(ModuleElement ast, IEolContext context);
/**
+ * The AST finished executing.
+ *
+ * @param ast the ast
* @param result the result of evaluating ast, calculated during execution
+ * @param context the context
*/
public void finishedExecuting(ModuleElement ast, Object result, IEolContext context);
+ /**
+ * The AST finished executing with an exception.
+ *
+ * @param ast the ast
+ * @param exception the exception
+ * @param context the context
+ */
public void finishedExecutingWithException(ModuleElement ast, EolRuntimeException exception, IEolContext context);
}
diff --git a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/types/EolModelElementType.java b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/types/EolModelElementType.java
index 984d6f9..85534aa 100644
--- a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/types/EolModelElementType.java
+++ b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/types/EolModelElementType.java
@@ -40,14 +40,13 @@
this.metaClass = metaClass;
this.typeName = metaClass.getName();
}
-
+
public EolModelElementType(String modelAndMetaClass) {
if (modelAndMetaClass.contains("!")) {
String[] parts = modelAndMetaClass.split("!");
modelName = parts[0];
typeName = parts[1];
- }
- else {
+ } else {
modelName = "";
typeName = modelAndMetaClass;
}
@@ -84,21 +83,22 @@
if (statement == null)
return "";
else
- return "(" + statement.getFile() + "@" + statement.getRegion().getStart().getLine() + ":" + statement.getRegion().getStart().getColumn() + ")";
+ return "(" + statement.getFile() + "@" + statement.getRegion().getStart().getLine() + ":"
+ + statement.getRegion().getStart().getColumn() + ")";
}
public String getModelName() {
return modelName;
}
-
+
public void setModelName(String model) {
this.modelName = model;
}
-
+
public String getTypeName() {
return typeName;
}
-
+
public void setTypeName(String type) {
this.typeName = type;
}
@@ -122,11 +122,11 @@
return Collections.emptyList();
}
}
-
+
public Collection<?> getAll() {
return getAllOfKind();
}
-
+
public Collection<?> all() {
return getAllOfKind();
}
@@ -142,7 +142,7 @@
public boolean isInstantiable() throws EolModelElementTypeNotFoundException {
return getModel().isInstantiable(typeName);
}
-
+
@Override
public boolean isType(Object o) {
try {
@@ -153,7 +153,7 @@
return false;
}
}
-
+
@Override
public Object createInstance() throws EolRuntimeException {
return getModel().createInstance(typeName);
@@ -163,7 +163,7 @@
public Object createInstance(List<Object> parameters) throws EolRuntimeException {
return getModel().createInstance(typeName, parameters);
}
-
+
@Override
public boolean isKind(Object o) {
try {
@@ -181,7 +181,7 @@
if (!modelName.isEmpty()) {
name = modelName + "!";
}
- return name + typeName;
+ return name + typeName;
}
public IModel getModel() throws EolModelElementTypeNotFoundException {
@@ -220,11 +220,11 @@
public MetaClass getMetaClass() {
return metaClass;
}
-
+
public void setMetaClass(MetaClass metaClass) {
this.metaClass = metaClass;
}
-
+
@Override
public String toString() {
return getName();
diff --git a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/Constraint.java b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/Constraint.java
index ef2e2fa..0ceeb52 100644
--- a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/Constraint.java
+++ b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/Constraint.java
@@ -97,6 +97,7 @@
return true;
}
+ // FIXME : The ContraintContext already did the type checking, why do it again?
/**
*
diff --git a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/ConstraintContext.java b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/ConstraintContext.java
index 9189f00..3c464e0 100644
--- a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/ConstraintContext.java
+++ b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/dom/ConstraintContext.java
@@ -42,7 +42,7 @@
@SuppressWarnings("unchecked")
public void build(AST cst, IModule module) {
super.build(cst, module);
-
+
typeExpression = (TypeExpression) module.createAst(cst.getFirstChild(), this);
guardBlock = (ExecutableBlock<Boolean>) module.createAst(AstUtil.getChild(cst, EvlParser.GUARD), this);
@@ -103,20 +103,22 @@
public ArrayList<Constraint> getConstraints() {
return constraints;
}
-
+
public TypeExpression getTypeExpression() {
return typeExpression;
}
-
+
public void setTypeExpression(TypeExpression typeExpression) {
this.typeExpression = typeExpression;
}
-
- public Collection<?> getAllOfSourceType(IEvlContext context) throws EolModelElementTypeNotFoundException, EolModelNotFoundException {
+
+ public Collection<?> getAllOfSourceType(IEvlContext context)
+ throws EolModelElementTypeNotFoundException, EolModelNotFoundException {
return getType(context).getAllOfType();
}
- public Collection<?> getAllOfSourceKind(IEvlContext context) throws EolModelElementTypeNotFoundException, EolModelNotFoundException {
+ public Collection<?> getAllOfSourceKind(IEvlContext context)
+ throws EolModelElementTypeNotFoundException, EolModelNotFoundException {
return getType(context).getAllOfKind();
}
diff --git a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/execute/EvlOperationFactory.java b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/execute/EvlOperationFactory.java
index 76e97f9..f31ada8 100644
--- a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/execute/EvlOperationFactory.java
+++ b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/execute/EvlOperationFactory.java
@@ -14,11 +14,15 @@
public class EvlOperationFactory extends EolOperationFactory {
+ public static final String SATISFIES_ALL_OPERATION = "satisfiesAll";
+ public static final String SATISFIES_ONE_OPERATION = "satisfiesOne";
+ public static final String SATISFIES_OPERATION = "satisfies";
+
public EvlOperationFactory() {
- SatisfiesOperation satisfiesAll = new SatisfiesOperation(true);
- operationCache.put("satisfies", satisfiesAll);
- operationCache.put("satisfiesAll", satisfiesAll);
- operationCache.put("satisfiesOne", new SatisfiesOperation(false));
+ super();
+ operationCache.put(SATISFIES_OPERATION, new SatisfiesOperation(true));
+ operationCache.put(SATISFIES_ALL_OPERATION, new SatisfiesOperation(true));
+ operationCache.put(SATISFIES_ONE_OPERATION, new SatisfiesOperation(false));
}
}
diff --git a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/trace/ConstraintTrace.java b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/trace/ConstraintTrace.java
index 941097b..347d38d 100644
--- a/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/trace/ConstraintTrace.java
+++ b/plugins/org.eclipse.epsilon.evl.engine/src/org/eclipse/epsilon/evl/trace/ConstraintTrace.java
@@ -137,4 +137,13 @@
ConstraintTrace ct = (ConstraintTrace) other;
return Objects.equals(this.iterable, ct.iterable);
}
+ /**
+ * Removes all trace information
+ */
+ public void clear() {
+ storageOptimised.clear();
+ storage.clear();
+ iterable.clear();
+ }
+
}
diff --git a/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target b/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target
index 7fe31ed..663fb5c 100644
--- a/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target
+++ b/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target
@@ -6,15 +6,13 @@
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="http://download.eclipse.org/releases/photon/"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="2.14.0.v20180529-1157"/>
- <unit id="org.eclipse.emf.validation.sdk.feature.group" version="1.12.0.201805030717"/>
- <unit id="org.eclipse.equinox.sdk.feature.group" version="3.14.0.v20180518-2029"/>
- <unit id="org.eclipse.gef.sdk.feature.group" version="3.11.0.201606061308"/>
- <unit id="org.eclipse.gmf.feature.group" version="1.12.0.201806010809"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.12.0.201805221301"/>
- <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.12.0.201806010809"/>
- <unit id="org.eclipse.jdt.feature.group" version="3.14.0.v20180611-0500"/>
- <unit id="org.eclipse.modisco.sdk.feature.feature.group" version="1.2.0.201805182005"/>
+ <unit id="org.eclipse.emf.compare.ide.ui.source.feature.group" version="3.3.3.201805161152"/>
+ <unit id="org.eclipse.emf.compare.uml2.source.feature.group" version="3.3.3.201805161152"/>
+ <unit id="org.eclipse.ocl.all.sdk.feature.group" version="5.4.0.v20180611-1119"/>
+ <unit id="org.eclipse.sirius.runtime.feature.group" version="6.0.0.201806111309"/>
+ <unit id="org.eclipse.sirius.runtime.ide.ui.feature.group" version="6.0.0.201806111309"/>
+ <unit id="org.eclipse.xsd.sdk.feature.group" version="2.14.0.v20180131-0817"/>
+ <unit id="org.eclipse.xtext.sdk.feature.group" version="2.14.0.v20180523-0937"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.gmf.sdk.feature.group" version="3.2.1.201409171321"/>
@@ -23,11 +21,22 @@
<unit id="org.eclipse.gmf.tooling.runtime.feature.group" version="3.2.1.201409171321"/>
<repository location="http://download.eclipse.org/modeling/gmp/gmf-tooling/updates/releases"/>
</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="http://download.eclipse.org/releases/photon/"/>
- <unit id="org.eclipse.ocl.all.sdk.feature.group" version="5.4.0.v20180611-1119"/>
- <unit id="org.eclipse.xsd.sdk.feature.group" version="2.14.0.v20180131-0817"/>
- <unit id="org.eclipse.xtext.sdk.feature.group" version="2.14.0.v20180523-0937"/>
+ <unit id="org.eclipse.e4.core.tools.feature.feature.group" version="4.8.0.v20180512-1132"/>
+ <unit id="org.eclipse.emf.sdk.feature.group" version="2.14.0.v20180529-1157"/>
+ <unit id="org.eclipse.emf.validation.sdk.feature.group" version="1.12.0.201805030717"/>
+ <unit id="org.eclipse.equinox.sdk.feature.group" version="3.14.0.v20180518-2029"/>
+ <unit id="org.eclipse.gef.sdk.feature.group" version="3.11.0.201606061308"/>
+ <unit id="org.eclipse.gmf.feature.group" version="1.12.0.201806010809"/>
+ <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.12.0.201805221301"/>
+ <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.12.0.201806010809"/>
+ <unit id="org.eclipse.jdt.feature.group" version="3.14.0.v20180611-0500"/>
+ <unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.9.100.v201804120404"/>
+ <unit id="org.eclipse.platform.feature.group" version="4.8.0.v20180611-0656"/>
+ <unit id="org.eclipse.platform.sdk" version="4.8.0.I20180611-0500"/>
+ <unit id="org.eclipse.rcp.feature.group" version="4.8.0.v20180611-0656"/>
+ <unit id="org.eclipse.sdk.ide" version="4.8.0.I20180611-0500"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.pde.feature.group" version="3.13.100.v20180611-0826"/>
@@ -53,14 +62,19 @@
<unit id="org.dom4j.source" version="1.6.1.v201312101416"/>
<unit id="org.slf4j.api" version="1.7.2.v20121108-1250"/>
<unit id="org.slf4j.api.source" version="1.7.2.v20121108-1250"/>
-<unit id="org.slf4j.log4j" version="1.7.2.v20130115-1340"/>
-<unit id="org.slf4j.log4j.source" version="1.7.2.v20130115-1340"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository"/>
+ <unit id="ch.qos.logback.classic" version="1.1.2.v20160208-0839"/>
+ <unit id="ch.qos.logback.classic.source" version="1.1.2.v20160208-0839"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
-<unit id="org.antlr.runtime" version="3.2.0.v201101311130"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository"/>
+ <unit id="org.mockito" version="2.13.0.v20180426-1843"/>
+ <unit id="org.mockito.source" version="2.13.0.v20180426-1843"/>
+ <unit id="com.google.inject" version="3.0.0.v201605172100"/>
+ <unit id="com.google.inject.source" version="3.0.0.v201605172100"/>
+ <unit id="com.google.inject.assistedinject" version="3.0.0.v201402270930"/>
+ <unit id="com.google.inject.assistedinject.source" version="3.0.0.v201402270930"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.m2m.qvt.oml.sdk.feature.group" version="3.9.1.v20181210-1559"/>
diff --git a/tests/org.eclipse.epsilon.emc.csv.test/META-INF/MANIFEST.MF b/tests/org.eclipse.epsilon.emc.csv.test/META-INF/MANIFEST.MF
index ae0dc9e..6603351 100644
--- a/tests/org.eclipse.epsilon.emc.csv.test/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.epsilon.emc.csv.test/META-INF/MANIFEST.MF
@@ -7,5 +7,7 @@
Require-Bundle: org.hamcrest.library;bundle-version="1.3.0",
org.junit,
org.eclipse.epsilon.eol.engine;bundle-version="1.5.0",
- org.eclipse.epsilon.emc.csv
+ org.eclipse.epsilon.emc.csv,
+ org.apache.commons.csv_1.5;bundle-version="1.5.0",
+ org.slf4j.api
Export-Package: org.eclipse.epsilon.emc.csv.test
diff --git a/tests/org.eclipse.epsilon.emc.csv.test/src/org/eclipse/epsilon/emc/csv/test/BASE_MOCK_DATA.csv b/tests/org.eclipse.epsilon.emc.csv.test/src/org/eclipse/epsilon/emc/csv/test/BASE_MOCK_DATA.csv
index 7784b90..d63501c 100644
--- a/tests/org.eclipse.epsilon.emc.csv.test/src/org/eclipse/epsilon/emc/csv/test/BASE_MOCK_DATA.csv
+++ b/tests/org.eclipse.epsilon.emc.csv.test/src/org/eclipse/epsilon/emc/csv/test/BASE_MOCK_DATA.csv
@@ -17,5 +17,4 @@
318-48-3006,Constantino,Eyckelbeck,ceyckelbeckf@histats.com,Male,Recruiter,564182300132483644,In hac habitasse platea dictumst. Maecenas ut massa quis augue luctus tincidunt.,War
122-74-6759,Nickolas,Collard,ncollardg@dot.gov,Male,Web Designer IV,,Praesent blandit lacinia erat. Vestibulum sed magna at nunc commodo placerat.,Drama
309-57-3090,Chere,Hurry,churryh@huffingtonpost.com,Female,Tax Accountant,,"In tempor, turpis nec euismod scelerisque, quam turpis adipiscing lorem, vitae mattis nibh ligula nec sem.",Drama,Fantasy,Mystery
-833-32-9040,Mattie,Hamon,mhamoni@auda.org.au,Male,Structural Engineer,,Duis at velit eu est congue elementum. In hac habitasse platea dictumst.,Drama
101-82-2564,Hew,Goble,hgoblej@ocn.ne.jp,Male,VP Accounting,,Etiam pretium iaculis justo.,Comedy