|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
[jira] Created: (SCXML-74) <data> uses "name" attribute instead of "ID"<data> uses "name" attribute instead of "ID"
-------------------------------------------- Key: SCXML-74 URL: https://issues.apache.org/jira/browse/SCXML-74 Project: Commons SCXML Issue Type: Bug Affects Versions: 0.8 Reporter: Edzard Hoefig Priority: Minor In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. Example: This SCXML document... <?xml version="1.0" encoding="UTF-8"?> <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > <datamodel> <data id="RequestForBerlin"> <GetWeather xmlns="http://www.webserviceX.NET"> <CityName>Berlin</CityName> <CountryName>Germany</CountryName> </GetWeather> </data> </datamodel> <state id="InitialState"> <transition target="GetWeatherState"/> </state> <state id="GetWeatherState"> <invoke src="WeatherService#GetWeather" targettype="x-soap"> <param name="RequestForBerlin"/> </invoke> </state> </scxml> ... leads to ... ... java.lang.NullPointerException at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) [...] ... because the name field of a Data class instance is null. when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Updated: (SCXML-74) <data> uses "name" attribute instead of "ID"[ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rahul Akolkar updated SCXML-74: ------------------------------- Fix Version/s: 0.9 Remaining Estimate: (was: 2h) Original Estimate: (was: 2h) Thanks for pointing this out, I've set the fix version to be v0.9 (the next anticipated release). We have not updated to the latest WD, but we will need to go through the changes with a fine-toothed comb at some point (volunteers welcome :-). I won't be able to get to this for another week, but the fix should be fairly straightforward if anyone wants to take a stab at it (given that you're correctly identified the source code that needs updating). > <data> uses "name" attribute instead of "ID" > -------------------------------------------- > > Key: SCXML-74 > URL: https://issues.apache.org/jira/browse/SCXML-74 > Project: Commons SCXML > Issue Type: Bug > Affects Versions: 0.8 > Reporter: Edzard Hoefig > Priority: Minor > Fix For: 0.9 > > > In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. > Example: > This SCXML document... > <?xml version="1.0" encoding="UTF-8"?> > <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > > <datamodel> > <data id="RequestForBerlin"> > <GetWeather xmlns="http://www.webserviceX.NET"> > <CityName>Berlin</CityName> > <CountryName>Germany</CountryName> > </GetWeather> > </data> > </datamodel> > <state id="InitialState"> > <transition target="GetWeatherState"/> > </state> > <state id="GetWeatherState"> > <invoke src="WeatherService#GetWeather" targettype="x-soap"> > <param name="RequestForBerlin"/> > </invoke> > </state> > </scxml> > ... leads to ... > ... java.lang.NullPointerException > at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) > at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) > at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) > at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) > [...] > ... because the name field of a Data class instance is null. > when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (SCXML-74) <data> uses "name" attribute instead of "ID"[ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611955#action_12611955 ] Edzard Hoefig commented on SCXML-74: ------------------------------------ The issue seems to be fairly easily fixed (at least all junit tests stay green) by the following steps. I could also commit these to the SVN, but am unsure about the process followed in this project. :-) 1) Class org.apache.commons.scxml.SCXMLHelper.java Three changes in line 448, line 464, line 466 (in "cloneDatamodel") Use "datum.getId()" instead of "datum.getName()" (It is important to use the lowercase "Id" and not "ID", which is not working -- confusing the Digester?) 2) Class org.apache.commons.scxml.io.SCXMLSerializer.java One change in else clause starting on line 363 (in "serializeDatamodel") Use b.append(indent).append(INDENT).append("<data id=\""). append(datum.getId()).append("\" expr=\""). append(datum.getExpr()).append("\" />\n"); Instead of b.append(indent).append(INDENT).append("<data name=\""). append(datum.getName()).append("\" expr=\""). append(datum.getExpr()).append("\" />\n"); 3) Class org.apache.commons.scxml.model.Data.java Re-factor "name" attribute to "id", also change accessor methods: line 39 (the attribute name) line 68 (initialization in ctor) line 74ff: rename accessor methods, e.g. use these /** * Get the ID. * * @return String The identifier. */ public final String getId() { return id; } /** * Set the ID. * * @param id The identifier. */ public final void setId(final String id) { this.id = id; } 4) Refactor the xml test data files Use "id" instead of "name" as attribute in declaration of <data/> elements This has to be done for following files: org.apache.commons.scxml.custom-hello-world-04-el.xml org.apache.commons.scxml.custom-hello-world-04-jexl.xml org.apache.commons.scxml.env.jexl.datamodel-01.xml org.apache.commons.scxml.env.jexl.datamodel-02.xml org.apache.commons.scxml.env.jexl.datamodel-03.xml org.apache.commons.scxml.env.jexl.datamodel-04.xml org.apache.commons.scxml.env.jexl.eventdata-03.xml org.apache.commons.scxml.env.jsp.datamodel-01.xml org.apache.commons.scxml.env.jsp.datamodel-02.xml org.apache.commons.scxml.env.jsp.datamodel-03.xml org.apache.commons.scxml.issues.issue64-01.xml org.apache.commons.scxml.issues.issue64-02.xml org.apache.commons.scxml.model.assign-test.xml > <data> uses "name" attribute instead of "ID" > -------------------------------------------- > > Key: SCXML-74 > URL: https://issues.apache.org/jira/browse/SCXML-74 > Project: Commons SCXML > Issue Type: Bug > Affects Versions: 0.8 > Reporter: Edzard Hoefig > Priority: Minor > Fix For: 0.9 > > > In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. > Example: > This SCXML document... > <?xml version="1.0" encoding="UTF-8"?> > <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > > <datamodel> > <data id="RequestForBerlin"> > <GetWeather xmlns="http://www.webserviceX.NET"> > <CityName>Berlin</CityName> > <CountryName>Germany</CountryName> > </GetWeather> > </data> > </datamodel> > <state id="InitialState"> > <transition target="GetWeatherState"/> > </state> > <state id="GetWeatherState"> > <invoke src="WeatherService#GetWeather" targettype="x-soap"> > <param name="RequestForBerlin"/> > </invoke> > </state> > </scxml> > ... leads to ... > ... java.lang.NullPointerException > at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) > at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) > at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) > at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) > [...] > ... because the name field of a Data class instance is null. > when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (SCXML-74) <data> uses "name" attribute instead of "ID"[ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612299#action_12612299 ] Rahul Akolkar commented on SCXML-74: ------------------------------------ Thanks a lot for taking time to identify the changes. I should have pointed to the contributing patches page to make the process clearer: http://commons.apache.org/patches.html I will take a look at committing the necessary changes (may be a week or two). We should retain the ability to use "name" (instead of "id") for backwards compatibility. > <data> uses "name" attribute instead of "ID" > -------------------------------------------- > > Key: SCXML-74 > URL: https://issues.apache.org/jira/browse/SCXML-74 > Project: Commons SCXML > Issue Type: Bug > Affects Versions: 0.8 > Reporter: Edzard Hoefig > Priority: Minor > Fix For: 0.9 > > > In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. > Example: > This SCXML document... > <?xml version="1.0" encoding="UTF-8"?> > <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > > <datamodel> > <data id="RequestForBerlin"> > <GetWeather xmlns="http://www.webserviceX.NET"> > <CityName>Berlin</CityName> > <CountryName>Germany</CountryName> > </GetWeather> > </data> > </datamodel> > <state id="InitialState"> > <transition target="GetWeatherState"/> > </state> > <state id="GetWeatherState"> > <invoke src="WeatherService#GetWeather" targettype="x-soap"> > <param name="RequestForBerlin"/> > </invoke> > </state> > </scxml> > ... leads to ... > ... java.lang.NullPointerException > at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) > at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) > at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) > at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) > [...] > ... because the name field of a Data class instance is null. > when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Updated: (SCXML-74) <data> uses "name" attribute instead of "ID"[ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Edzard Hoefig updated SCXML-74: ------------------------------- Attachment: commons-scxml_data-id_patch_ehoefig Thanks for the pointer to the contribution process. Here is a patch for the identified changes. I left the "name" accessors in the Data class for backward compability; Both "id" and "name" accessors are referring to the same "id" attribute now. > <data> uses "name" attribute instead of "ID" > -------------------------------------------- > > Key: SCXML-74 > URL: https://issues.apache.org/jira/browse/SCXML-74 > Project: Commons SCXML > Issue Type: Bug > Affects Versions: 0.8 > Reporter: Edzard Hoefig > Priority: Minor > Fix For: 0.9 > > Attachments: commons-scxml_data-id_patch_ehoefig > > > In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. > Example: > This SCXML document... > <?xml version="1.0" encoding="UTF-8"?> > <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > > <datamodel> > <data id="RequestForBerlin"> > <GetWeather xmlns="http://www.webserviceX.NET"> > <CityName>Berlin</CityName> > <CountryName>Germany</CountryName> > </GetWeather> > </data> > </datamodel> > <state id="InitialState"> > <transition target="GetWeatherState"/> > </state> > <state id="GetWeatherState"> > <invoke src="WeatherService#GetWeather" targettype="x-soap"> > <param name="RequestForBerlin"/> > </invoke> > </state> > </scxml> > ... leads to ... > ... java.lang.NullPointerException > at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) > at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) > at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) > at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) > [...] > ... because the name field of a Data class instance is null. > when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Resolved: (SCXML-74) <data> uses "name" attribute instead of "ID"[ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rahul Akolkar resolved SCXML-74. -------------------------------- Resolution: Fixed Great, thanks for the patch. I've applied it in r676121 and added you as a contributor: http://svn.apache.org/viewvc?view=rev&revision=676121 I made two minor changes to your patch: * Deprecated the get/setName methods to indicate we recommend using id * The patch sporadically contained extra newlines at the end of some files, I removed those You can now try the latest code in trunk to verify that the fix works for you. Resolving as fixed. > <data> uses "name" attribute instead of "ID" > -------------------------------------------- > > Key: SCXML-74 > URL: https://issues.apache.org/jira/browse/SCXML-74 > Project: Commons SCXML > Issue Type: Bug > Affects Versions: 0.8 > Reporter: Edzard Hoefig > Priority: Minor > Fix For: 0.9 > > Attachments: commons-scxml_data-id_patch_ehoefig > > > In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. > Example: > This SCXML document... > <?xml version="1.0" encoding="UTF-8"?> > <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > > <datamodel> > <data id="RequestForBerlin"> > <GetWeather xmlns="http://www.webserviceX.NET"> > <CityName>Berlin</CityName> > <CountryName>Germany</CountryName> > </GetWeather> > </data> > </datamodel> > <state id="InitialState"> > <transition target="GetWeatherState"/> > </state> > <state id="GetWeatherState"> > <invoke src="WeatherService#GetWeather" targettype="x-soap"> > <param name="RequestForBerlin"/> > </invoke> > </state> > </scxml> > ... leads to ... > ... java.lang.NullPointerException > at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) > at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) > at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) > at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) > [...] > ... because the name field of a Data class instance is null. > when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Closed: (SCXML-74) <data> uses "name" attribute instead of "ID"[ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Edzard Hoefig closed SCXML-74. ------------------------------ Thank you, works fine for me now. > <data> uses "name" attribute instead of "ID" > -------------------------------------------- > > Key: SCXML-74 > URL: https://issues.apache.org/jira/browse/SCXML-74 > Project: Commons SCXML > Issue Type: Bug > Affects Versions: 0.8 > Reporter: Edzard Hoefig > Priority: Minor > Fix For: 0.9 > > Attachments: commons-scxml_data-id_patch_ehoefig > > > In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This change is not reflected in the source (see class org.apache.commons.scxml.model.Data) and leads to a NullPointerException when trying to use it. > Example: > This SCXML document... > <?xml version="1.0" encoding="UTF-8"?> > <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="InitialState" > > <datamodel> > <data id="RequestForBerlin"> > <GetWeather xmlns="http://www.webserviceX.NET"> > <CityName>Berlin</CityName> > <CountryName>Germany</CountryName> > </GetWeather> > </data> > </datamodel> > <state id="InitialState"> > <transition target="GetWeatherState"/> > </state> > <state id="GetWeatherState"> > <invoke src="WeatherService#GetWeather" targettype="x-soap"> > <param name="RequestForBerlin"/> > </invoke> > </state> > </scxml> > ... leads to ... > ... java.lang.NullPointerException > at org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164) > at org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466) > at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223) > at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351) > [...] > ... because the name field of a Data class instance is null. > when changing the <data id="RequestForBerlin"> line to <data name="RequestForBerlin"> the problem dissapears. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free Forum Powered by Nabble | Forum Help |