Skip to content
Snippets Groups Projects
Commit 007ccd19 authored by BIGARET Sebastien's avatar BIGARET Sebastien
Browse files

Merge branch 'dev', for version 2016.10-1

parents 304c29f4 cef73ff4
No related branches found
No related tags found
No related merge requests found
Pipeline #115 failed
......@@ -13,8 +13,9 @@
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="XMCDA-java"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/XMCDA-NG/build.xml}"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/XMCDA-java/build.xml}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/XMCDA-NG}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/XMCDA-java}"/>
</launchConfiguration>
CHANGES 0 → 100644
v2016.10-1
----------
- ProgramExecutionResult.Status.exitStatus() semantic changes:it now
returns 0 for both OK and WARNING status, 1 for ERROR and 2 for
TERMINATED.
This allows programs to use it as their own return status,
considering that both OK and WARNING status indicates a valid
execution.
v2016.10
--------
First public release.
......@@ -8,7 +8,7 @@ import java.util.ArrayList;
* <li>its global {@link #getStatus()} status,</li>
* <li>a list of @{link {@link Message messages}.</li>
* </ul>
* Its status is normally deduced when the object is built:
* Its status is normally deduced during the lifespan of this object:
* <ul>
* <li>it starts with the default value OK;</li>
* <li>its seriouness is elevated to WARNING as soon as a warning message is added;</li>
......@@ -19,7 +19,7 @@ import java.util.ArrayList;
* this: {@code OK < WARNING < ERROR < TERMINATED}; its value always goes up, e.g. from OK to ERROR but never fall
* back to a smaller value.<br/>
* <br/>
*The TERMINIATED value has a special behaviour: it can only be set (or replaced by an other status) by using
* The TERMINATED value has a special behaviour: it can only be set (or replaced by an other status) by using
* {@link #forceStatus(Status)}. It is intended to signal that the program has been terminated by an external
* mean, when possible (for example after receiving a signal from the operating system, or terminated by the user,
* etc.).
......@@ -32,15 +32,18 @@ public class ProgramExecutionResult
extends ArrayList<Message>
implements HasDescription, CommonAttributes, java.io.Serializable, XMCDARootElement
{
/** This enumerates the statuses that a program execution result
* {@link ProgramExecutionResult#getStatus() can have}.
/**
* This enumerates the statuses that a program execution result {@link ProgramExecutionResult#getStatus() can have}.
* A program can use this to determine its own return status code. Both status {@code OK} and {@code WARNING} means
* that a program's execution is successful, even if a {@code WARNING} status tells that the user may have to
* check the outputs and/or the warning messages issued by the program.
*/
public static enum Status
{
/** Status OK means that neither {@link #addWarning(String)} nor {@link #addError(String)} have been called */
OK,
/** Status WARNING means that at least a warning has been signaled with {@link #addWarning(String)}, but that
* no {@link #addError(String) errors} have been signalled. */
* no {@link #addError(String) errors} have been signaled. */
WARNING,
/** Status ERROR means that at least an error has been signaled with {@link #addError(String)}. */
ERROR,
......@@ -48,11 +51,30 @@ public class ProgramExecutionResult
* {@link #forceStatus(Status) forceStatus(Status.TERMINATED)} */
TERMINATED;
/**
* Returns the exit status corresponding to this status. A program typically use this for returning its own exit
* status.
* <ul>
* <li>{@code OK} and {@WARNING} status represents a successful execution, hence the return code is {@code 0}
* (zero),
* <li>{@code ERROR} returns 1,
* <li>{@code TERMINATED} return 2.
*
* @return 0 for {@code OK} and {@code WARNING}, 1 for {@code ERROR} and 2 for {@code TERMINATED}.
*/
public int exitStatus()
{
return this.ordinal();
switch (this)
{
case OK:
case WARNING: return 0;
case ERROR: return 1;
case TERMINATED: return 2;
default:
throw new RuntimeException("Unknown status :" + this.toString());
}
}
};
}
private static final long serialVersionUID = 1L;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment