Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba

Proposed by Paul J. Lucas on 2014-03-20
Status: Merged
Approved by: Paul J. Lucas on 2014-03-20
Approved revision: 11485
Merged at revision: 11709
Proposed branch: lp:~paul-lucas/zorba/pjl-misc
Merge into: lp:zorba
Diff against target: 83 lines (+26/-2)
5 files modified
src/runtime/base/plan_iterator.cpp (+1/-1)
src/runtime/json/snelson.cpp (+2/-0)
src/runtime/jsound/jsound_util.cpp (+3/-1)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-j2x-object-06.xml.res (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-j2x-object-06.xq (+12/-0)
To merge this branch: bzr merge lp:~paul-lucas/zorba/pjl-misc
Reviewer Review Type Date Requested Status
Matthias Brantner 2014-03-20 Approve on 2014-03-20
Paul J. Lucas Approve on 2014-03-20
Review via email: mp+211848@code.launchpad.net

Commit message

1. Fixed user-reported core-dump for JSON-to-XML conversion.
2. Now also using getNameAsString() in PlanIterator.
3. Normalizing whitespace for JSound constraint error messages so they print better.

Description of the change

1. Fixed user-reported core-dump for JSON-to-XML conversion.
2. Now also using getNameAsString() in PlanIterator.
3. Normalizing whitespace for JSound constraint error messages so they print better.

To post a comment you must log in.
Paul J. Lucas (paul-lucas) :
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/211848

Progress dashboard at http://jenkins.zorba.io:8180/view/ValidationQueue

Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/211848 :
Votes: {'Approve': 1}

Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/211848

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu:8180/job/CommitZorba/309/console to view the results.

review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/211848

Progress dashboard at http://jenkins.zorba.io:8180/view/ValidationQueue

Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/base/plan_iterator.cpp'
2--- src/runtime/base/plan_iterator.cpp 2014-02-25 00:14:59 +0000
3+++ src/runtime/base/plan_iterator.cpp 2014-03-20 02:10:46 +0000
4@@ -232,7 +232,7 @@
5 else
6 std::cout << "next (" << iter;
7
8- std::cout << " = " << typeid (*iter).name()
9+ std::cout << " = " << iter->getNameAsString() // typeid (*iter).name()
10 << ") -> "
11 << "status: " << status << " -> "
12 << ((status && result != NULL) ? result->show().c_str() : "null")
13
14=== modified file 'src/runtime/json/snelson.cpp'
15--- src/runtime/json/snelson.cpp 2013-12-27 15:11:16 +0000
16+++ src/runtime/json/snelson.cpp 2014-03-20 02:10:46 +0000
17@@ -186,6 +186,7 @@
18 ADD_PAIR_ELEMENT( value_item->getStringValue() );
19 PUSH_ITEM( xml );
20 value_item = json_item->getObjectValue( value_item );
21+ ZORBA_ASSERT( !!value_item );
22 added_pair_element = true;
23 }
24
25@@ -246,6 +247,7 @@
26 ADD_TYPE_ATTRIBUTE( "array" );
27 ADD_ITEM_ELEMENT( "array" );
28 PUSH_STATE( in_array );
29+ PUSH_ITEM( json );
30 PUSH_ITERATOR( cur_iter );
31 cur_iter = value_item->getArrayValues();
32 cur_iter->open();
33
34=== modified file 'src/runtime/jsound/jsound_util.cpp'
35--- src/runtime/jsound/jsound_util.cpp 2014-03-14 22:38:03 +0000
36+++ src/runtime/jsound/jsound_util.cpp 2014-03-20 02:10:46 +0000
37@@ -1951,13 +1951,15 @@
38 it->open();
39 while ( it->next( item ) ) {
40 ASSERT_TYPE( item, "constraint", XS_STRING );
41- zstring const constraint_str( item->getStringValue() );
42+ zstring constraint_str( item->getStringValue() );
43 try {
44 unique_ptr<constraint> c( new constraint( constraint_str ) );
45 constraints_.push_back( c.get() );
46 c.release();
47 }
48 catch ( ZorbaException const &e ) {
49+ ascii::replace_all( constraint_str, '\n', ' ' );
50+ ascii::normalize_space( constraint_str );
51 throw XQUERY_EXCEPTION(
52 jse::ILLEGAL_FACET_VALUE,
53 ERROR_PARAMS(
54
55=== added file 'test/rbkt/ExpQueryResults/zorba/json/json-snelson-j2x-object-06.xml.res'
56--- test/rbkt/ExpQueryResults/zorba/json/json-snelson-j2x-object-06.xml.res 1970-01-01 00:00:00 +0000
57+++ test/rbkt/ExpQueryResults/zorba/json/json-snelson-j2x-object-06.xml.res 2014-03-20 02:10:46 +0000
58@@ -0,0 +1,8 @@
59+<json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object">
60+ <pair name="x" type="object">
61+ <pair name="a" type="array">
62+ <item type="number">1</item>
63+ </pair>
64+ <pair name="b" type="number">2</pair>
65+ </pair>
66+</json>
67
68=== added file 'test/rbkt/Queries/zorba/json/json-snelson-j2x-object-06.xq'
69--- test/rbkt/Queries/zorba/json/json-snelson-j2x-object-06.xq 1970-01-01 00:00:00 +0000
70+++ test/rbkt/Queries/zorba/json/json-snelson-j2x-object-06.xq 2014-03-20 02:10:46 +0000
71@@ -0,0 +1,12 @@
72+import module namespace jx = "http://zorba.io/modules/json-xml";
73+
74+let $json :=
75+ {
76+ "x" : {
77+ "a" : [ 1 ],
78+ "b" : 2
79+ }
80+ }
81+return jx:json-to-xml( $json )
82+
83+(: vim:set et sw=2 ts=2: :)

Subscribers

People subscribed via source and target branches