You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Denis Kishenko (JIRA)" <ji...@apache.org> on 2006/08/01 16:14:13 UTC
[jira] Created: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
[classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
--------------------------------------------------------------------------------------------
Key: HARMONY-1033
URL: http://issues.apache.org/jira/browse/HARMONY-1033
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Denis Kishenko
Specs 1.5
Methods throws
NullPointerException - if a is null.
IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
public class bug9276 {
public static void main (String[] args) {
try {
Character.codePointAt(null, 6, 4);
System.err.println("failed 1");
} catch (IndexOutOfBoundsException e) {
System.err.println("passed 1");
e.printStackTrace();
} catch (Exception e) {
System.err.println("failed 1");
e.printStackTrace();
}
try {
Character.codePointAt(null, 4, 6);
System.err.println("failed 2");
} catch (NullPointerException e) {
System.err.println("passed 2");
e.printStackTrace();
} catch (Exception e) {
System.err.println("failed 2");
e.printStackTrace();
}
try {
Character.codePointAt(null, 0, 0);
System.err.println("failed 3");
} catch (IndexOutOfBoundsException e) {
System.err.println("passed 3");
e.printStackTrace();
} catch (Exception e) {
System.err.println("failed 3");
e.printStackTrace();
}
}
}
Output
RI --------------------------------------------------------------------
passed 1
java.lang.IndexOutOfBoundsException
at java.lang.Character.codePointAt(Character.java:2400)
at bug9276.main(bug9276.java:6)
passed 2
java.lang.NullPointerException
at java.lang.Character.codePointAt(Character.java:2399)
at bug9276.main(bug9276.java:16)
passed 3
java.lang.IndexOutOfBoundsException
at java.lang.Character.codePointAt(Character.java:2400)
at bug9276.main(bug9276.java:26)
Harmony -----------------------------------------------------------
failed 1
java.lang.NullPointerException
at java.lang.Character.codePointAt(Character.java:1918)
at bug9276.main(bug9276.java:6)
passed 2
java.lang.NullPointerException
at java.lang.Character.codePointAt(Character.java:1918)
at bug9276.main(bug9276.java:16)
failed 3
java.lang.NullPointerException
at java.lang.Character.codePointAt(Character.java:1918)
at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
RE: [jira] Commented: (HARMONY-1033) [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
Posted by Nathan Beyer <nb...@kc.rr.com>.
This patch seems fine. My concern is that the original patch would make the
code unreadable and confusing. Post a new patch file to the JIRA issue and
I'll apply it. Thanks.
-Nathan
> -----Original Message-----
> From: Denis Kishenko [mailto:dkishenko@gmail.com]
> Sent: Wednesday, August 02, 2006 3:31 AM
> To: harmony-dev@incubator.apache.org
> Subject: Re: [jira] Commented: (HARMONY-1033)
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for
> Character.codePointAt
>
> 2006/8/2, Andrew Zhang <zh...@gmail.com>:
> > Does following exception check code work?
> >
> > if (index < 0 || index >= limit || limit < 0 || limit >
> seq.length)
> > {
> > throw new IndexOutOfBoundsException();
> > }
> >
> > The above code also throws NullPointerException if seq is null, and the
> > order of exception seems the same as the patch.
> >
> > Does it make sense? Please correct me if I miss something. :)
> Yep, it's absolutely correct and looks better =)
>
> Nathan as far as I understand you mean Harmony exception behavior is
> more logically than RI. Should we continue discussion or you will
> approve Alex's implementation?
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [jira] Commented: (HARMONY-1033) [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
Posted by Denis Kishenko <dk...@gmail.com>.
2006/8/2, Andrew Zhang <zh...@gmail.com>:
> Does following exception check code work?
>
> if (index < 0 || index >= limit || limit < 0 || limit > seq.length)
> {
> throw new IndexOutOfBoundsException();
> }
>
> The above code also throws NullPointerException if seq is null, and the
> order of exception seems the same as the patch.
>
> Does it make sense? Please correct me if I miss something. :)
Yep, it's absolutely correct and looks better =)
Nathan as far as I understand you mean Harmony exception behavior is
more logically than RI. Should we continue discussion or you will
approve Alex's implementation?
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [jira] Commented: (HARMONY-1033) [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
Posted by Andrew Zhang <zh...@gmail.com>.
Hi,
Does following exception check code work?
if (index < 0 || index >= limit || limit < 0 || limit > seq.length)
{
throw new IndexOutOfBoundsException();
}
The above code also throws NullPointerException if seq is null, and the
order of exception seems the same as the patch.
Does it make sense? Please correct me if I miss something. :)
Thanks!
On 8/2/06, Denis Kishenko <dk...@gmail.com> wrote:
>
> Hi all
>
> We have strange exceptions behavior of RI implementation of
> Character.codePointAt.method.
>
> Spec 1.5 says
> public static int codePointAt(char[] a, int index, int limit)
> Throws:
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if the index argument is negative or
> not less than the limit argument, or if the limit argument is negative
> or greater than the length of the char array.
>
> Practicallty we have
>
> RI
> Character.codePointAt(null, 6, 4) - IndexOutOfBoundsException
> Character.codePointAt(null, 4, 6) - NPE
> Character.codePointAt(null, 0, 0) - IndexOutOfBoundsException
>
> Harmony
> Character.codePointAt(null, 6, 4) - NPE
> Character.codePointAt(null, 4, 6) - NPE
> Character.codePointAt(null, 0, 0) - NPE
>
> Should we follow RI to repeat behavior of exceptions?
>
> 2006/8/2, Nathan Beyer (JIRA) <ji...@apache.org>:
> > [
> http://issues.apache.org/jira/browse/HARMONY-1033?page=comments#action_12425114]
> >
> > Nathan Beyer commented on HARMONY-1033:
> > ---------------------------------------
> >
> > This seems like an extreme edge case. The code implements the
> specification and Harmony's results aren't surprising. I suggest bringing
> this up on the mailing list for additional feedback, as I'm not inclined to
> move forward with this change. The resulting code seems very awkward.
> >
> > > [classlib][lang]compatibility: expected IndexOutOfBoundsException
> for Character.codePointAt
> > >
> --------------------------------------------------------------------------------------------
> > >
> > > Key: HARMONY-1033
> > > URL: http://issues.apache.org/jira/browse/HARMONY-1033
> > > Project: Harmony
> > > Issue Type: Bug
> > > Components: Classlib
> > > Reporter: Denis Kishenko
> > > Assigned To: Nathan Beyer
> > > Attachments: Character.patch, CharacterTest.patch
> > >
> > >
> > > Specs 1.5
> > > Methods throws
> > > NullPointerException - if a is null.
> > > IndexOutOfBoundsException - if offset or count is negative, or if
> offset + count is larger than the length of the given array.
> > > If first argument is null RI throws NPE only in the second test, it's
> strange, but we have to follow.
> > > public class bug9276 {
> > > public static void main (String[] args) {
> > > try {
> > > Character.codePointAt(null, 6, 4);
> > > System.err.println("failed 1");
> > > } catch (IndexOutOfBoundsException e) {
> > > System.err.println("passed 1");
> > > e.printStackTrace();
> > > } catch (Exception e) {
> > > System.err.println("failed 1");
> > > e.printStackTrace();
> > > }
> > > try {
> > > Character.codePointAt(null, 4, 6);
> > > System.err.println("failed 2");
> > > } catch (NullPointerException e) {
> > > System.err.println("passed 2");
> > > e.printStackTrace();
> > > } catch (Exception e) {
> > > System.err.println("failed 2");
> > > e.printStackTrace();
> > > }
> > > try {
> > > Character.codePointAt(null, 0, 0);
> > > System.err.println("failed 3");
> > > } catch (IndexOutOfBoundsException e) {
> > > System.err.println("passed 3");
> > > e.printStackTrace();
> > > } catch (Exception e) {
> > > System.err.println("failed 3");
> > > e.printStackTrace();
> > > }
> > > }
> > >
> > > }
> > > Output
> > > RI
> --------------------------------------------------------------------
> > > passed 1
> > > java.lang.IndexOutOfBoundsException
> > > at java.lang.Character.codePointAt(Character.java:2400)
> > > at bug9276.main(bug9276.java:6)
> > > passed 2
> > > java.lang.NullPointerException
> > > at java.lang.Character.codePointAt(Character.java:2399)
> > > at bug9276.main(bug9276.java:16)
> > > passed 3
> > > java.lang.IndexOutOfBoundsException
> > > at java.lang.Character.codePointAt(Character.java:2400)
> > > at bug9276.main(bug9276.java:26)
> > > Harmony -----------------------------------------------------------
> > > failed 1
> > > java.lang.NullPointerException
> > > at java.lang.Character.codePointAt(Character.java:1918)
> > > at bug9276.main(bug9276.java:6)
> > > passed 2
> > > java.lang.NullPointerException
> > > at java.lang.Character.codePointAt(Character.java:1918)
> > > at bug9276.main(bug9276.java:16)
> > > failed 3
> > > java.lang.NullPointerException
> > > at java.lang.Character.codePointAt(Character.java:1918)
> > > at bug9276.main(bug9276.java:26)
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >
> >
> >
>
>
> --
> Denis M. Kishenko
> Intel Middleware Products Division
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
--
Andrew Zhang
China Software Development Lab, IBM
Re: [jira] Commented: (HARMONY-1033) [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
Posted by Denis Kishenko <dk...@gmail.com>.
Hi all
We have strange exceptions behavior of RI implementation of
Character.codePointAt.method.
Spec 1.5 says
public static int codePointAt(char[] a, int index, int limit)
Throws:
NullPointerException - if a is null.
IndexOutOfBoundsException - if the index argument is negative or
not less than the limit argument, or if the limit argument is negative
or greater than the length of the char array.
Practicallty we have
RI
Character.codePointAt(null, 6, 4) - IndexOutOfBoundsException
Character.codePointAt(null, 4, 6) - NPE
Character.codePointAt(null, 0, 0) - IndexOutOfBoundsException
Harmony
Character.codePointAt(null, 6, 4) - NPE
Character.codePointAt(null, 4, 6) - NPE
Character.codePointAt(null, 0, 0) - NPE
Should we follow RI to repeat behavior of exceptions?
2006/8/2, Nathan Beyer (JIRA) <ji...@apache.org>:
> [ http://issues.apache.org/jira/browse/HARMONY-1033?page=comments#action_12425114 ]
>
> Nathan Beyer commented on HARMONY-1033:
> ---------------------------------------
>
> This seems like an extreme edge case. The code implements the specification and Harmony's results aren't surprising. I suggest bringing this up on the mailing list for additional feedback, as I'm not inclined to move forward with this change. The resulting code seems very awkward.
>
> > [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> > --------------------------------------------------------------------------------------------
> >
> > Key: HARMONY-1033
> > URL: http://issues.apache.org/jira/browse/HARMONY-1033
> > Project: Harmony
> > Issue Type: Bug
> > Components: Classlib
> > Reporter: Denis Kishenko
> > Assigned To: Nathan Beyer
> > Attachments: Character.patch, CharacterTest.patch
> >
> >
> > Specs 1.5
> > Methods throws
> > NullPointerException - if a is null.
> > IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> > If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> > public class bug9276 {
> > public static void main (String[] args) {
> > try {
> > Character.codePointAt(null, 6, 4);
> > System.err.println("failed 1");
> > } catch (IndexOutOfBoundsException e) {
> > System.err.println("passed 1");
> > e.printStackTrace();
> > } catch (Exception e) {
> > System.err.println("failed 1");
> > e.printStackTrace();
> > }
> > try {
> > Character.codePointAt(null, 4, 6);
> > System.err.println("failed 2");
> > } catch (NullPointerException e) {
> > System.err.println("passed 2");
> > e.printStackTrace();
> > } catch (Exception e) {
> > System.err.println("failed 2");
> > e.printStackTrace();
> > }
> > try {
> > Character.codePointAt(null, 0, 0);
> > System.err.println("failed 3");
> > } catch (IndexOutOfBoundsException e) {
> > System.err.println("passed 3");
> > e.printStackTrace();
> > } catch (Exception e) {
> > System.err.println("failed 3");
> > e.printStackTrace();
> > }
> > }
> >
> > }
> > Output
> > RI --------------------------------------------------------------------
> > passed 1
> > java.lang.IndexOutOfBoundsException
> > at java.lang.Character.codePointAt(Character.java:2400)
> > at bug9276.main(bug9276.java:6)
> > passed 2
> > java.lang.NullPointerException
> > at java.lang.Character.codePointAt(Character.java:2399)
> > at bug9276.main(bug9276.java:16)
> > passed 3
> > java.lang.IndexOutOfBoundsException
> > at java.lang.Character.codePointAt(Character.java:2400)
> > at bug9276.main(bug9276.java:26)
> > Harmony -----------------------------------------------------------
> > failed 1
> > java.lang.NullPointerException
> > at java.lang.Character.codePointAt(Character.java:1918)
> > at bug9276.main(bug9276.java:6)
> > passed 2
> > java.lang.NullPointerException
> > at java.lang.Character.codePointAt(Character.java:1918)
> > at bug9276.main(bug9276.java:16)
> > failed 3
> > java.lang.NullPointerException
> > at java.lang.Character.codePointAt(Character.java:1918)
> > at bug9276.main(bug9276.java:26)
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
--
Denis M. Kishenko
Intel Middleware Products Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
[jira] Assigned: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=all ]
Nathan Beyer reassigned HARMONY-1033:
-------------------------------------
Assignee: Nathan Beyer
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=all ]
Denis Kishenko updated HARMONY-1033:
------------------------------------
Attachment: Character.patch
patch
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Attachments: Character.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=all ]
Denis Kishenko updated HARMONY-1033:
------------------------------------
Attachment: CharacterTest.patch
patch for junit test
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Attachments: Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=comments#action_12425156 ]
Denis Kishenko commented on HARMONY-1033:
-----------------------------------------
OK
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=all ]
Denis Kishenko updated HARMONY-1033:
------------------------------------
Attachment: Character.patch
Patch is suggested by Andrew Zhang
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=comments#action_12426152 ]
Denis Kishenko commented on HARMONY-1033:
-----------------------------------------
Verified, it's ok.
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=all ]
Nathan Beyer closed HARMONY-1033.
---------------------------------
Verified.
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=comments#action_12425114 ]
Nathan Beyer commented on HARMONY-1033:
---------------------------------------
This seems like an extreme edge case. The code implements the specification and Harmony's results aren't surprising. I suggest bringing this up on the mailing list for additional feedback, as I'm not inclined to move forward with this change. The resulting code seems very awkward.
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-1033) [classlib][lang]compatibility:
expected IndexOutOfBoundsException for Character.codePointAt
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1033?page=all ]
Nathan Beyer resolved HARMONY-1033.
-----------------------------------
Resolution: Fixed
Patch applied at r429044. Please verify that is resolves the issue. Thanks.
> [classlib][lang]compatibility: expected IndexOutOfBoundsException for Character.codePointAt
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-1033
> URL: http://issues.apache.org/jira/browse/HARMONY-1033
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Nathan Beyer
> Attachments: Character.patch, Character.patch, CharacterTest.patch
>
>
> Specs 1.5
> Methods throws
> NullPointerException - if a is null.
> IndexOutOfBoundsException - if offset or count is negative, or if offset + count is larger than the length of the given array.
> If first argument is null RI throws NPE only in the second test, it's strange, but we have to follow.
> public class bug9276 {
> public static void main (String[] args) {
> try {
> Character.codePointAt(null, 6, 4);
> System.err.println("failed 1");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 1");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 1");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 4, 6);
> System.err.println("failed 2");
> } catch (NullPointerException e) {
> System.err.println("passed 2");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 2");
> e.printStackTrace();
> }
> try {
> Character.codePointAt(null, 0, 0);
> System.err.println("failed 3");
> } catch (IndexOutOfBoundsException e) {
> System.err.println("passed 3");
> e.printStackTrace();
> } catch (Exception e) {
> System.err.println("failed 3");
> e.printStackTrace();
> }
> }
>
> }
> Output
> RI --------------------------------------------------------------------
> passed 1
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:2399)
> at bug9276.main(bug9276.java:16)
> passed 3
> java.lang.IndexOutOfBoundsException
> at java.lang.Character.codePointAt(Character.java:2400)
> at bug9276.main(bug9276.java:26)
> Harmony -----------------------------------------------------------
> failed 1
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:6)
> passed 2
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:16)
> failed 3
> java.lang.NullPointerException
> at java.lang.Character.codePointAt(Character.java:1918)
> at bug9276.main(bug9276.java:26)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira