You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/01 13:30:20 UTC
[jira] [Commented] (SCXML-251) src attribute is not available for
data elements
[ https://issues.apache.org/jira/browse/SCXML-251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15402025#comment-15402025 ]
ASF GitHub Bot commented on SCXML-251:
--------------------------------------
Github user woonsan commented on a diff in the pull request:
https://github.com/apache/commons-scxml/pull/2#discussion_r72977373
--- Diff: src/main/java/org/apache/commons/scxml2/io/SCXMLReader.java ---
@@ -1094,7 +1094,21 @@ private static void readData(final XMLStreamReader reader, final Configuration c
Data datum = new Data();
datum.setId(readRequiredAV(reader, ELEM_DATA, ATTR_ID));
- datum.setExpr(readAV(reader, ATTR_EXPR));
+ final String expr = readAV(reader, ATTR_EXPR);
+ final String src = readAV(reader, ATTR_SRC);
+
+ if (expr != null && src != null) {
+ LogFactory.getLog(SCXMLReader.class).error(
+ "Found src and expr attributes for data node '" + datum.getId() + "', which is not valid SCXML.");
+ throw new ModelException();
--- End diff --
I think you should invoke #reportConflictingAttribute(reader, configuration, ...) instead here. That method leaves logs in a consistent manner and can handle strict or non-strict mode properly.
> src attribute is not available for data elements
> ------------------------------------------------
>
> Key: SCXML-251
> URL: https://issues.apache.org/jira/browse/SCXML-251
> Project: Commons SCXML
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Tobias Lippert
> Priority: Minor
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> The read routine ignores the "src" attribute in <data> elements in the data model.
> The field should be available to allow for users of the library to identify data elements with a src, and process the value of the attribute.
> The Data class itself already has the src member, and the corresponding getters and setters.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)