Merge lp:~paul-lucas/zorba/bug-1108515 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 11218
Merged at revision: 11217
Proposed branch: lp:~paul-lucas/zorba/bug-1108515
Merge into: lp:zorba
Diff against target: 363 lines (+119/-46)
7 files modified
src/diagnostics/diagnostic_en.xml (+7/-1)
src/diagnostics/pregenerated/dict_en.cpp (+3/-1)
src/diagnostics/pregenerated/dict_zed_keys.h (+2/-0)
src/store/naive/json_items.cpp (+5/-3)
src/store/naive/pul_primitives.cpp (+28/-12)
src/store/naive/simple_lazy_temp_seq.cpp (+45/-17)
src/store/naive/simple_temp_seq.cpp (+29/-12)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-1108515
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+146316@code.launchpad.net

Commit message

Fixed incorrect error reporting

Description of the change

Fixed incorrect error reporting

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
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 bug-1108515-2013-02-03T19-06-33.908Z 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 Approve.

lp:~paul-lucas/zorba/bug-1108515 updated
11218. By Paul J. Lucas

Tweaked braces to make Markos happy.

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 :

Validation queue job bug-1108515-2013-02-04T05-11-25.912Z 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
=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml 2013-01-30 15:19:38 +0000
+++ src/diagnostics/diagnostic_en.xml 2013-02-04 00:33:24 +0000
@@ -2735,7 +2735,13 @@
2735 </diagnostic>2735 </diagnostic>
27362736
2737 <diagnostic code="ZSTR0060" name="RANGE_EXCEPTION">2737 <diagnostic code="ZSTR0060" name="RANGE_EXCEPTION">
2738 <value>out of range: $1</value>2738 <value>"$1": value out of range${ 2}</value>
2739 <entry key="ForCollection_3">
2740 <value>for collection "$3"</value>
2741 </entry>
2742 <entry key="ForSequence">
2743 <value>for sequence</value>
2744 </entry>
2739 </diagnostic>2745 </diagnostic>
27402746
2741 <diagnostic code="ZSTR0065" name="STRINGS_IN_POOL">2747 <diagnostic code="ZSTR0065" name="STRINGS_IN_POOL">
27422748
=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp 2013-01-30 16:43:55 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp 2013-02-04 00:33:24 +0000
@@ -469,7 +469,7 @@
469 { "ZSTR0045", "duplicate node found in sequence" },469 { "ZSTR0045", "duplicate node found in sequence" },
470 { "ZSTR0050", "\"$1\" not implemented for item type \"$2\"" },470 { "ZSTR0050", "\"$1\" not implemented for item type \"$2\"" },
471 { "ZSTR0055", "streamable string has already been consumed" },471 { "ZSTR0055", "streamable string has already been consumed" },
472 { "ZSTR0060", "out of range: $1" },472 { "ZSTR0060", "\"$1\": value out of range${ 2}" },
473 { "ZSTR0065", "Zorba did not close properly, objects may still in memory.\\n$1 referenced URI(s) remain in the string pool.\\nFor help avoiding this message please refer to http://www.zorba-xquery.com/html/documentation in section General Architecture -> Memory Leaks." },473 { "ZSTR0065", "Zorba did not close properly, objects may still in memory.\\n$1 referenced URI(s) remain in the string pool.\\nFor help avoiding this message please refer to http://www.zorba-xquery.com/html/documentation in section General Architecture -> Memory Leaks." },
474 { "ZSTR0066", "$1: does not reference a node in collection $2" },474 { "ZSTR0066", "$1: does not reference a node in collection $2" },
475 { "ZWST0002", "\"$1\": unknown or unsupported annotation" },475 { "ZWST0002", "\"$1\": unknown or unsupported annotation" },
@@ -935,6 +935,8 @@
935 { "~ZDST0027_NO_KEY_TYPE_DECL", "value index missing key type declaration" },935 { "~ZDST0027_NO_KEY_TYPE_DECL", "value index missing key type declaration" },
936 { "~ZDST0060_unknown_localname", "unknown localname ($3)" },936 { "~ZDST0060_unknown_localname", "unknown localname ($3)" },
937 { "~ZDST0060_unknown_namespace", "unknown namespace ($3)" },937 { "~ZDST0060_unknown_namespace", "unknown namespace ($3)" },
938 { "~ZSTR0060_ForCollection_3", "for collection \"$3\"" },
939 { "~ZSTR0060_ForSequence", "for sequence" },
938 { "~ZWST0005_PARAM_TYPE", "type of parameter $3 is $4 which is not a subtype of xs:anyAtomicType" },940 { "~ZWST0005_PARAM_TYPE", "type of parameter $3 is $4 which is not a subtype of xs:anyAtomicType" },
939 { "~ZWST0005_RETURN_TYPE", "return type ($3) is not subtype of xs:anyAtomicType" },941 { "~ZWST0005_RETURN_TYPE", "return type ($3) is not subtype of xs:anyAtomicType" },
940 { "~ZWST0005_UPDATING", "function is updating" },942 { "~ZWST0005_UPDATING", "function is updating" },
941943
=== modified file 'src/diagnostics/pregenerated/dict_zed_keys.h'
--- src/diagnostics/pregenerated/dict_zed_keys.h 2013-01-23 17:24:44 +0000
+++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-02-04 00:33:24 +0000
@@ -90,6 +90,8 @@
90#define ZED_ZDST0027_NON_ORDERED_KEY_TYPE "~ZDST0027_NON_ORDERED_KEY_TYPE"90#define ZED_ZDST0027_NON_ORDERED_KEY_TYPE "~ZDST0027_NON_ORDERED_KEY_TYPE"
91#define ZED_ZDST0060_unknown_namespace "~ZDST0060_unknown_namespace"91#define ZED_ZDST0060_unknown_namespace "~ZDST0060_unknown_namespace"
92#define ZED_ZDST0060_unknown_localname "~ZDST0060_unknown_localname"92#define ZED_ZDST0060_unknown_localname "~ZDST0060_unknown_localname"
93#define ZED_ZSTR0060_ForCollection_3 "~ZSTR0060_ForCollection_3"
94#define ZED_ZSTR0060_ForSequence "~ZSTR0060_ForSequence"
93#define ZED_JNUP0007_Object "~JNUP0007_Object"95#define ZED_JNUP0007_Object "~JNUP0007_Object"
94#define ZED_JNUP0007_Array "~JNUP0007_Array"96#define ZED_JNUP0007_Array "~JNUP0007_Array"
95#define ZED_JNUP0007_ObjectArray "~JNUP0007_ObjectArray"97#define ZED_JNUP0007_ObjectArray "~JNUP0007_ObjectArray"
9698
=== modified file 'src/store/naive/json_items.cpp'
--- src/store/naive/json_items.cpp 2013-01-08 05:02:54 +0000
+++ src/store/naive/json_items.cpp 2013-02-04 00:33:24 +0000
@@ -1014,10 +1014,12 @@
1014 {1014 {
1015 return to_xs_unsignedLong(i);1015 return to_xs_unsignedLong(i);
1016 }1016 }
1017 catch (std::range_error& e)1017 catch (std::range_error const&)
1018 {1018 {
1019 throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION,1019 throw ZORBA_EXCEPTION(
1020 ERROR_PARAMS(BUILD_STRING("access out of bounds " << e.what() << ")")));1020 zerr::ZSTR0060_RANGE_EXCEPTION,
1021 ERROR_PARAMS( i )
1022 );
1021 }1023 }
1022}1024}
10231025
10241026
=== modified file 'src/store/naive/pul_primitives.cpp'
--- src/store/naive/pul_primitives.cpp 2013-01-22 11:07:53 +0000
+++ src/store/naive/pul_primitives.cpp 2013-02-04 00:33:24 +0000
@@ -1024,11 +1024,15 @@
1024 {1024 {
1025 size = to_xs_unsignedLong(collection->size());1025 size = to_xs_unsignedLong(collection->size());
1026 }1026 }
1027 catch (std::range_error& e)1027 catch (std::range_error const&)
1028 {1028 {
1029 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,1029 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,
1030 ERROR_PARAMS(BUILD_STRING("collection too big ("1030 ERROR_PARAMS(
1031 << e.what() << "; " << theName << ")")));1031 collection->size(),
1032 ZED( ZSTR0060_ForCollection_3 ),
1033 theName
1034 )
1035 );
1032 }1036 }
10331037
1034 for (uint64_t i = 0; i < size; ++i)1038 for (uint64_t i = 0; i < size; ++i)
@@ -1101,11 +1105,15 @@
1101 {1105 {
1102 lastPos = to_xs_unsignedLong(lColl->size()) - 1;1106 lastPos = to_xs_unsignedLong(lColl->size()) - 1;
1103 }1107 }
1104 catch (std::range_error& e)1108 catch (std::range_error const&)
1105 {1109 {
1106 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,1110 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,
1107 ERROR_PARAMS(BUILD_STRING("collection too big ("1111 ERROR_PARAMS(
1108 << e.what() << "; " << theName << ")")));1112 lColl->size(),
1113 ZED( ZSTR0060_ForCollection_3 ),
1114 theName
1115 )
1116 );
1109 }1117 }
11101118
1111 for (long i = theNumApplied-1; i >= 0; --i)1119 for (long i = theNumApplied-1; i >= 0; --i)
@@ -1192,11 +1200,15 @@
1192 {1200 {
1193 lastPos = to_xs_unsignedLong(lColl->size()) - 1;1201 lastPos = to_xs_unsignedLong(lColl->size()) - 1;
1194 }1202 }
1195 catch (std::range_error& e)1203 catch (std::range_error const&)
1196 {1204 {
1197 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,1205 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,
1198 ERROR_PARAMS(BUILD_STRING("collection too big ("1206 ERROR_PARAMS(
1199 << e.what() << "; " << theName << ")")));1207 lColl->size(),
1208 ZED( ZSTR0060_ForCollection_3 ),
1209 theName
1210 )
1211 );
1200 }1212 }
12011213
1202 xs_integer const xs_lastPos( lastPos );1214 xs_integer const xs_lastPos( lastPos );
@@ -1291,11 +1303,15 @@
1291 {1303 {
1292 size = to_xs_unsignedLong(coll->size());1304 size = to_xs_unsignedLong(coll->size());
1293 }1305 }
1294 catch (std::range_error& e)1306 catch (std::range_error const&)
1295 {1307 {
1296 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,1308 RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc,
1297 ERROR_PARAMS(BUILD_STRING("collection too big ("1309 ERROR_PARAMS(
1298 << e.what() << "; " << theName << ")")));1310 coll->size(),
1311 ZED( ZSTR0060_ForCollection_3 ),
1312 theName
1313 )
1314 );
1299 }1315 }
13001316
1301 csize numNodes = theNodes.size();1317 csize numNodes = theNodes.size();
13021318
=== modified file 'src/store/naive/simple_lazy_temp_seq.cpp'
--- src/store/naive/simple_lazy_temp_seq.cpp 2012-09-19 21:16:15 +0000
+++ src/store/naive/simple_lazy_temp_seq.cpp 2013-02-04 00:33:24 +0000
@@ -16,9 +16,11 @@
16#include "stdafx.h"16#include "stdafx.h"
17#include <limits>17#include <limits>
1818
19#include "diagnostics/xquery_exception.h"19#include <zorba/diagnostic_list.h>
20#include "diagnostics/assert.h"20#include "diagnostics/assert.h"
21#include "diagnostics/dict.h"
21#include "diagnostics/util_macros.h"22#include "diagnostics/util_macros.h"
23#include "diagnostics/xquery_exception.h"
2224
23#include "store/api/item.h"25#include "store/api/item.h"
24#include "simple_lazy_temp_seq.h"26#include "simple_lazy_temp_seq.h"
@@ -170,10 +172,10 @@
170 {172 {
171 pos = to_xs_long(position);173 pos = to_xs_long(position);
172 }174 }
173 catch (std::range_error& e)175 catch (std::range_error const&)
174 {176 {
175 throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION,177 throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION,
176 ERROR_PARAMS(BUILD_STRING("sequence too big (" << e.what() << ")")));178 ERROR_PARAMS(position,ZED(ZSTR0060_ForSequence)));
177 }179 }
178180
179 ZORBA_ASSERT(pos >= thePurgedUpTo);181 ZORBA_ASSERT(pos >= thePurgedUpTo);
@@ -202,10 +204,10 @@
202 {204 {
203 pos = to_xs_long(position);205 pos = to_xs_long(position);
204 }206 }
205 catch (std::range_error& e)207 catch (std::range_error const&)
206 {208 {
207 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,209 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,
208 ERROR_PARAMS(BUILD_STRING("access out of bounds " << e.what() << ")")));210 ERROR_PARAMS(position,ZED(ZSTR0060_ForSequence)));
209 }211 }
210212
211 ZORBA_ASSERT(pos > thePurgedUpTo);213 ZORBA_ASSERT(pos > thePurgedUpTo);
@@ -255,10 +257,10 @@
255 {257 {
256 pos = to_xs_long(position);258 pos = to_xs_long(position);
257 }259 }
258 catch (std::range_error& e)260 catch (std::range_error const&)
259 {261 {
260 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,262 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,
261 ERROR_PARAMS(BUILD_STRING("access out of bounds " << e.what() << ")")));263 ERROR_PARAMS(position,ZED(ZSTR0060_ForSequence)));
262 }264 }
263265
264 ZORBA_ASSERT(pos > thePurgedUpTo);266 ZORBA_ASSERT(pos > thePurgedUpTo);
@@ -317,17 +319,30 @@
317 :319 :
318 theTempSeq(const_cast<SimpleLazyTempSeq*>(tempSeq))320 theTempSeq(const_cast<SimpleLazyTempSeq*>(tempSeq))
319{321{
320 try 322 try
321 {323 {
322 theStartPos = to_xs_long(startPos);324 theStartPos = to_xs_long(startPos);
325 }
326 catch ( std::range_error const& )
327 {
328 throw ZORBA_EXCEPTION(
329 zerr::ZSTR0060_RANGE_EXCEPTION,
330 ERROR_PARAMS( startPos, ZED( ZSTR0060_ForSequence ) )
331 );
332 }
333 try
334 {
323 theEndPos = to_xs_long(endPos);335 theEndPos = to_xs_long(endPos);
324 theCurPos = theStartPos - 1;
325 }336 }
326 catch (std::range_error& e)337 catch ( std::range_error const& )
327 {338 {
328 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,339 throw ZORBA_EXCEPTION(
329 ERROR_PARAMS(BUILD_STRING("sequence too big (" << e.what() << ")")));340 zerr::ZSTR0060_RANGE_EXCEPTION,
341 ERROR_PARAMS( endPos, ZED( ZSTR0060_ForSequence ) )
342 );
330 }343 }
344
345 theCurPos = theStartPos - 1;
331}346}
332347
333348
@@ -360,17 +375,30 @@
360375
361 theTempSeq = static_cast<SimpleLazyTempSeq*>(seq.getp());376 theTempSeq = static_cast<SimpleLazyTempSeq*>(seq.getp());
362377
363 try 378 try
364 {379 {
365 theStartPos = to_xs_long(startPos);380 theStartPos = to_xs_long(startPos);
381 }
382 catch ( std::range_error const& )
383 {
384 throw ZORBA_EXCEPTION(
385 zerr::ZSTR0060_RANGE_EXCEPTION,
386 ERROR_PARAMS( startPos, ZED( ZSTR0060_ForSequence ) )
387 );
388 }
389 try
390 {
366 theEndPos = to_xs_long(endPos);391 theEndPos = to_xs_long(endPos);
367 theCurPos = theStartPos - 1;
368 }392 }
369 catch (std::range_error& e)393 catch ( std::range_error const& )
370 {394 {
371 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,395 throw ZORBA_EXCEPTION(
372 ERROR_PARAMS(BUILD_STRING("sequence too big (" << e.what() << ")")));396 zerr::ZSTR0060_RANGE_EXCEPTION,
397 ERROR_PARAMS( endPos, ZED( ZSTR0060_ForSequence ) )
398 );
373 }399 }
400
401 theCurPos = theStartPos - 1;
374}402}
375403
376404
377405
=== modified file 'src/store/naive/simple_temp_seq.cpp'
--- src/store/naive/simple_temp_seq.cpp 2012-09-19 21:16:15 +0000
+++ src/store/naive/simple_temp_seq.cpp 2013-02-04 00:33:24 +0000
@@ -15,10 +15,11 @@
15 */15 */
16#include "stdafx.h"16#include "stdafx.h"
1717
18#include "diagnostics/xquery_exception.h"18#include <zorba/diagnostic_list.h>
19#include "zorba/diagnostic_list.h"
20#include "diagnostics/diagnostic.h"19#include "diagnostics/diagnostic.h"
20#include "diagnostics/dict.h"
21#include "diagnostics/util_macros.h"21#include "diagnostics/util_macros.h"
22#include "diagnostics/zorba_exception.h"
2223
23#include "store/api/item.h"24#include "store/api/item.h"
24#include "simple_temp_seq.h"25#include "simple_temp_seq.h"
@@ -167,10 +168,12 @@
167 {168 {
168 pos = to_xs_long(position);169 pos = to_xs_long(position);
169 }170 }
170 catch (std::range_error& e)171 catch (std::range_error const&)
171 {172 {
172 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,173 throw ZORBA_EXCEPTION(
173 ERROR_PARAMS(BUILD_STRING("access out of bounds " << e.what() << ")")));174 zerr::ZSTR0060_RANGE_EXCEPTION,
175 ERROR_PARAMS( position, ZED(ZSTR0060_ForSequence) )
176 );
174 }177 }
175178
176 if (0 < pos && pos <= theItems.size())179 if (0 < pos && pos <= theItems.size())
@@ -194,10 +197,12 @@
194 {197 {
195 pos = to_xs_long(position);198 pos = to_xs_long(position);
196 }199 }
197 catch (std::range_error& e)200 catch (std::range_error const&)
198 {201 {
199 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,202 throw ZORBA_EXCEPTION(
200 ERROR_PARAMS(BUILD_STRING("access out of bounds " << e.what() << ")")));203 zerr::ZSTR0060_RANGE_EXCEPTION,
204 ERROR_PARAMS( position, ZED(ZSTR0060_ForSequence) )
205 );
201 }206 }
202207
203 return 0 < pos && pos <= theItems.size();208 return 0 < pos && pos <= theItems.size();
@@ -260,15 +265,27 @@
260 xs_long start;265 xs_long start;
261 xs_long end;266 xs_long end;
262267
263 try 268 try
264 {269 {
265 start = to_xs_long(startPos);270 start = to_xs_long(startPos);
271 }
272 catch ( std::range_error const& )
273 {
274 throw ZORBA_EXCEPTION(
275 zerr::ZSTR0060_RANGE_EXCEPTION,
276 ERROR_PARAMS( start, ZED(ZSTR0060_ForSequence) )
277 );
278 }
279 try
280 {
266 end = to_xs_long(endPos);281 end = to_xs_long(endPos);
267 }282 }
268 catch (std::range_error& e)283 catch ( std::range_error const& )
269 {284 {
270 RAISE_ERROR_NO_LOC(zerr::ZSTR0060_RANGE_EXCEPTION,285 throw ZORBA_EXCEPTION(
271 ERROR_PARAMS(BUILD_STRING("access out of bounds " << e.what() << ")")));286 zerr::ZSTR0060_RANGE_EXCEPTION,
287 ERROR_PARAMS( end, ZED(ZSTR0060_ForSequence) )
288 );
272 }289 }
273290
274 if (start > 0 && end > 0)291 if (start > 0 && end > 0)

Subscribers

People subscribed via source and target branches