Merge lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027 into lp:zorba

Proposed by Cezar Andrei
Status: Merged
Approved by: Cezar Andrei
Approved revision: 11203
Merged at revision: 11227
Proposed branch: lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027
Merge into: lp:zorba
Diff against target: 147 lines (+29/-23)
5 files modified
ChangeLog (+1/-0)
src/diagnostics/diagnostic_en.xml (+12/-4)
src/diagnostics/pregenerated/dict_en.cpp (+2/-0)
src/diagnostics/pregenerated/dict_zed_keys.h (+2/-0)
src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp (+12/-19)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+145036@code.launchpad.net

Commit message

Fixes how error XQDY0027 is constructed.

Description of the change

Fixes how error XQDY0027 is constructed.

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug867068-fixErrorXQDY0027-2013-01-25T22-23-00.553Z is
  finished. The final status was:

  3 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

invalid serialization parameters element name must be "serialization parameters"

That needs some reworking (some punctuation or something).

review: Needs Fixing
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

Fix for Paul's comment is in.

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

It's still wrong. It ought to be something like:

"$2": invalid serialization parameters; element name must be "serialization-parameters"

"$2": invalid namespace for the "serialization-parameters" element; must be "http://www.w3.org/2010/xslt-xquery-serialization"

You can't join two sentences together with a comma; see http://en.wikipedia.org/wiki/Comma_splice

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug867068-fixErrorXQDY0027-2013-01-29T19-40-48.099Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Needs Fixing, 1 Pending.

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

I don't like the use of the RAISE_ERROR macro. (This is something Marcos added.) It only obfuscates the "throw" statement. It's slightly less typing, but, in this case, I prefer clarity over conciseness. That said, I'll still approve it.

review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug867068-fixErrorXQDY0027-2013-02-01T22-08-49.879Z is
  finished. The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug867068-fixErrorXQDY0027-2013-02-05T04-23-27.931Z is
  finished. The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

Added entry in ChangeLog.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug867068-fixErrorXQDY0027 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug867068-fixErrorXQDY0027-2013-02-06T20-58-35.305Z is
  finished. The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in ChangeLog

11203. By Cezar Andrei <email address hidden>

Merge from trunk, fix conflict in ChangeLog.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug867068-fixErrorXQDY0027-2013-02-08T22-18-57.923Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-02-08 18:31:22 +0000
3+++ ChangeLog 2013-02-08 22:17:27 +0000
4@@ -23,6 +23,7 @@
5 * Fixed bug #1099648 and #1088886 (XML parsing failures on Red Hat)
6 * Fixed bug #1099535 (xml:parse endless loop)
7 * Fixed bug #866958 (Parsing error not explicit enough)
8+ * Fixed bug #867068: (Incorrect usage of XQDY0027)
9
10
11 version 2.8
12
13=== modified file 'src/diagnostics/diagnostic_en.xml'
14--- src/diagnostics/diagnostic_en.xml 2013-02-08 01:58:24 +0000
15+++ src/diagnostics/diagnostic_en.xml 2013-02-08 22:17:27 +0000
16@@ -863,6 +863,14 @@
17 either \c valid or \c notKnown if validation mode is \c lax.
18 </comment>
19 <value>"$1": unexpected validity property${: 2}</value>
20+
21+ <entry key="SerializationElementName_2">
22+ <value>"$2": invalid serialization parameters; element name must be "serialization-parameters"</value>
23+ </entry>
24+
25+ <entry key="SerializationElementNs_2">
26+ <value>"$2": invalid namespace for the "serialization-parameters" element; must be "http://www.w3.org/2010/xslt-xquery-serialization"</value>
27+ </entry>
28 </diagnostic>
29
30 <diagnostic code="XQDY0041">
31@@ -2465,19 +2473,19 @@
32 <diagnostic code="ZDDY0037" name="COLLECTION_APPEND_BAD_EDIT">
33 <value>"$1": illegal edit in append-only collection</value>
34 </diagnostic>
35-
36+
37 <diagnostic code="ZDDY0038" name="COLLECTION_QUEUE_BAD_EDIT">
38 <value>"$1": illegal edit from queue collection</value>
39 </diagnostic>
40-
41+
42 <diagnostic code="ZDDY0039" name="NON_ROOT_NODE_EDIT">
43 <value>attempt to edit non-root node in collection "$1"</value>
44 </diagnostic>
45-
46+
47 <diagnostic code="ZDDY0040" name="INCONSISTENT_EDIT">
48 <value>attempt to edit an item with a template of a different kind (for example an object with a node).</value>
49 </diagnostic>
50-
51+
52 <diagnostic code="ZDST0001" name="COLLECTION_ALREADY_DECLARED">
53 <value>"$1": collection already declared</value>
54 </diagnostic>
55
56=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
57--- src/diagnostics/pregenerated/dict_en.cpp 2013-02-08 01:58:24 +0000
58+++ src/diagnostics/pregenerated/dict_en.cpp 2013-02-08 22:17:27 +0000
59@@ -918,6 +918,8 @@
60 { "~XPTY0004_NoTypePromote_23", "$2 can not be promoted to type $3" },
61 { "~XPTY0117_NodeCast", "Cannot cast node to xs:QName" },
62 { "~XPTY0117_NotationParam_23", "$2 can not be promoted to parameter type xs:NOTATION of function $3()" },
63+ { "~XQDY0027_SerializationElementName_2", "\"$2\": invalid serialization parameters; element name must be \"serialization-parameters\"" },
64+ { "~XQDY0027_SerializationElementNs_2", "\"$2\": invalid namespace for the \"serialization-parameters\" element; must be \"http://www.w3.org/2010/xslt-xquery-serialization\"" },
65 { "~XQST0046_BadHexDigit_3", "'$3': invalid hexedecimal digit" },
66 { "~XQST0059_SpecificationMessage", "\"$2\": target namespace not found for schema/module${ \"3\"}${: 4}" },
67 { "~XQST0059_XercesMessage", "$2,$3: error in schema${ with System ID \"4\"}${ with Public ID \"5\"}${: 6}" },
68
69=== modified file 'src/diagnostics/pregenerated/dict_zed_keys.h'
70--- src/diagnostics/pregenerated/dict_zed_keys.h 2013-02-08 01:58:24 +0000
71+++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-02-08 22:17:27 +0000
72@@ -57,6 +57,8 @@
73 #define ZED_XPDY0002_VariableHasNoValue_2 "~XPDY0002_VariableHasNoValue_2"
74 #define ZED_XPDY0002_VariableUndeclared_2 "~XPDY0002_VariableUndeclared_2"
75 #define ZED_XPDY0002_ContextUndeclared_2 "~XPDY0002_ContextUndeclared_2"
76+#define ZED_XQDY0027_SerializationElementName_2 "~XQDY0027_SerializationElementName_2"
77+#define ZED_XQDY0027_SerializationElementNs_2 "~XQDY0027_SerializationElementNs_2"
78 #define ZED_FTST0009_BadStopWordsLang "~FTST0009_BadStopWordsLang"
79 #define ZED_FTST0009_BadStemmerLang "~FTST0009_BadStemmerLang"
80 #define ZED_FTST0009_BadThesaurusLang "~FTST0009_BadThesaurusLang"
81
82=== modified file 'src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp'
83--- src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp 2012-10-08 12:09:36 +0000
84+++ src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp 2013-02-08 22:17:27 +0000
85@@ -26,6 +26,9 @@
86 #include "runtime/api/plan_iterator_wrapper.h"
87 #include "compiler/api/compilercb.h"
88
89+#include "diagnostics/assert.h"
90+#include "diagnostics/util_macros.h"
91+
92 #include "store/api/store.h"
93 #include "store/api/item.h"
94 #include "store/api/item_factory.h"
95@@ -74,9 +77,9 @@
96 is = iss.get();
97 }
98
99-
100+
101 baseUri = theSctx->get_base_uri();
102-
103+
104
105 try {
106 store::LoadProperties loadProps;
107@@ -117,12 +120,10 @@
108 if (lElemName->getLocalName() != "serialization-parameters")
109 {
110 ztd::string_builder lSb;
111- lSb << "the serialization parameters element must have the name \"serialization parameters\". "
112- << "\"" << lElemName->getLocalName() << "\" was found";
113- throw XQUERY_EXCEPTION(
114- err::XQDY0027,
115- ERROR_PARAMS(lSb.str()),
116- ERROR_LOC( aLoc ));
117+ lSb << lElemName->getLocalName();
118+
119+ RAISE_ERROR(err::XQDY0027, aLoc,
120+ ERROR_PARAMS(ZED(XQDY0027_SerializationElementName_2), lSb));
121 }
122
123 // the provided element must be in the correct namespace otherwise
124@@ -131,20 +132,12 @@
125 if (lElemName->getNamespace() != "http://www.w3.org/2010/xslt-xquery-serialization")
126 {
127 ztd::string_builder lSb;
128- zstring lFoundNs("No");
129+ zstring lFoundNs("");
130 if (lElemName->getNamespace().size() > 0)
131- {
132- lFoundNs = "<";
133 lFoundNs += lElemName->getNamespace();
134- lFoundNs += ">";
135- }
136
137- lSb << "the serialization-parameters element must be in the <http://www.w3.org/2010/xslt-xquery-serialization> namespace. "
138- << lFoundNs << " namespace was found";
139- throw XQUERY_EXCEPTION(
140- err::XQDY0027,
141- ERROR_PARAMS(lSb .str()),
142- ERROR_LOC( aLoc ));
143+ RAISE_ERROR(err::XQDY0027, aLoc,
144+ ERROR_PARAMS(ZED(XQDY0027_SerializationElementNs_2), lFoundNs));
145 }
146
147 #ifndef ZORBA_NO_XMLSCHEMA

Subscribers

People subscribed via source and target branches