Issue 96133 - i18npool: ambiguous && ||
Summary: i18npool: ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: Internationalization
Classification: Code
Component: i18npool (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: stefan.baltzer
QA Contact: issues@l10n
URL:
Keywords:
: 96372 96830 (view as issue list)
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-12 09:42 UTC by caolanm
Modified: 2013-08-07 15:02 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
keeps the logic as it is now, but makes it explicit (742 bytes, patch)
2008-11-12 09:43 UTC, caolanm
no flags Details | Diff
changes current behaviour, but might be what was intended (740 bytes, patch)
2008-11-12 09:43 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-12 09:42:34 UTC
in i18npool/source/breakiterator/breakiteratorImpl.cxx

we have in case WordType::WORD_COUNT:

while (nPos > 0 && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, -1))) ||
isZWSP(ch)) nPos=pos;

operator precedence of && before || gives this the meaning of

while ((nPos > 0 && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, -1)))) ||
isZWSP(ch)) nPos=pos;

(as attachment one does to make it explicit)

but looking at the *other* case statements that looks a little suspicious, the
other similar ones do...

while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) ||
isZWSP(ch))) nPos=pos;

so the intent *might* have been as in attachment 2 [details] to make the logic equivalent
to the other types
Comment 1 caolanm 2008-11-12 09:43:10 UTC
Created attachment 57920 [details]
keeps the logic as it is now, but makes it explicit
Comment 2 caolanm 2008-11-12 09:43:53 UTC
Created attachment 57921 [details]
changes current behaviour, but might be what was intended
Comment 3 pavel 2008-11-12 11:51:41 UTC
reassign

Comment 4 caolanm 2008-12-03 10:11:02 UTC
*** Issue 96830 has been marked as a duplicate of this issue. ***
Comment 5 ooo 2008-12-03 13:26:22 UTC
Karl, please review and apply the appropriate solution to your next CWS. If you
review and tell me before 10:00 UTC tomorrow (Thursday) I can as well add that
to my CWS locales31.
Comment 6 karl.hong 2008-12-12 04:58:33 UTC
It was my typo. It should be same like other case.

Fixed in i18n49.
Comment 7 karl.hong 2008-12-12 05:06:16 UTC
Test case can be found in i96133
(https://so-web.germany.sun.com/iBIS/servlet/edit.ControlPanel?tid=i96133)
Comment 8 karl.hong 2008-12-12 05:07:40 UTC
Sorry, test case can be found in
https://so-web.germany.sun.com/iBIS/servlet/edit.ControlPanel?tid=i96372
Comment 9 karl.hong 2008-12-12 05:12:56 UTC
*** Issue 96372 has been marked as a duplicate of this issue. ***
Comment 10 karl.hong 2008-12-17 08:57:50 UTC
ready for QA.
Comment 11 stefan.baltzer 2009-01-23 11:02:59 UTC
Verified in CWS i18n49.
Comment 12 dtardon 2009-04-08 15:01:24 UTC
seen in OOO310_m9 and DEV300_m45