You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Anton Ivanov (JIRA)" <ji...@apache.org> on 2006/12/05 14:44:21 UTC
[jira] Created: (HARMONY-2464) Compatibility: reset() method called
on Buffer without mark() previously called should cause
InvalidMarkException
Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
-----------------------------------------------------------------------------------------------------------------
Key: HARMONY-2464
URL: http://issues.apache.org/jira/browse/HARMONY-2464
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Anton Ivanov
Priority: Minor
There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
that mark is defined (set) for the duplicate Buffer?
If we believe so, we can call reset() method on duplicate Buffer according to specification.
But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
The same problem arises when we use asReadOnly() method instead of duplicate() method.
Test to reproduce the problem:
import junit.framework.TestCase;
import java.nio.CharBuffer;
import java.nio.InvalidMarkException;
public class Test extends TestCase {
public void test1() {
char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
CharBuffer cb = CharBuffer.wrap(cc);
try {
cb.mark();
CharBuffer roBuf = cb.asReadOnlyBuffer();
roBuf.reset();
fail("InvalidMarkException should be thrown");
} catch (InvalidMarkException e) {
//passed
}
}
public void test2() {
char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
CharBuffer cb = CharBuffer.wrap(cc);
try {
cb.mark();
CharBuffer dupBuf = cb.duplicate();
dupBuf.reset();
fail("InvalidMarkException should be thrown");
} catch (InvalidMarkException e) {
//passed
}
}
}
--
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] Assigned: (HARMONY-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2464?page=all ]
Tim Ellison reassigned HARMONY-2464:
------------------------------------
Assignee: Tim Ellison
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: http://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Anton Ivanov
> Assigned To: Tim Ellison
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
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-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2464?page=comments#action_12461009 ]
Tim Ellison commented on HARMONY-2464:
--------------------------------------
This should be marked as a non-bug difference.
Incidently, the tests show that these bugs have been fixed in Sun's 6.0 impl.
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: http://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Anton Ivanov
> Assigned To: Tim Ellison
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
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-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison updated HARMONY-2464:
---------------------------------
Component/s: (was: Classlib)
Non-bug differences from RI
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: https://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Reporter: Anton Ivanov
> Assigned To: Tim Ellison
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2464?page=all ]
Alexei Zakharov updated HARMONY-2464:
-------------------------------------
Summary: [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException (was: Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException)
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: http://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Anton Ivanov
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
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-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison resolved HARMONY-2464.
----------------------------------
Resolution: Won't Fix
Deemed to be bug in RI 5.0
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: https://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Reporter: Anton Ivanov
> Assigned To: Tim Ellison
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463817 ]
Mikhail Markov commented on HARMONY-2464:
-----------------------------------------
I've also checked this testcase on RI - it does not throw InvalidMarkexception on JDK6 and Harmony and throws the exception on JDK5.
So, +1 for moving it to "non-bug difference" category and closing it as "won't fix".
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: https://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Anton Ivanov
> Assigned To: Tim Ellison
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (HARMONY-2464) [classlib][nio] Compatibility:
reset() method called on Buffer without mark() previously called should
cause InvalidMarkException
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison closed HARMONY-2464.
--------------------------------
> [classlib][nio] Compatibility: reset() method called on Buffer without mark() previously called should cause InvalidMarkException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2464
> URL: https://issues.apache.org/jira/browse/HARMONY-2464
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Reporter: Anton Ivanov
> Assigned To: Tim Ellison
> Priority: Minor
>
> There are some obscure things about reset(), duplicate(), asReadOnly() methods in specification.
> When we obtain a duplicate of this Buffer (for example IntBuffer) by calling to its duplicate() method
> this duplicate Buffer has identical to original Buffer mark, position, limit and capacity values (according to specification).
> But the question is: If mark is defined (set) for original Buffer after mark() method was called on it can we believe
> that mark is defined (set) for the duplicate Buffer?
> If we believe so, we can call reset() method on duplicate Buffer according to specification.
> But RI throws InvalidMarkException here. Is this a RI bug or Harmony bug?
> The same problem arises when we use asReadOnly() method instead of duplicate() method.
> Test to reproduce the problem:
> import junit.framework.TestCase;
> import java.nio.CharBuffer;
> import java.nio.InvalidMarkException;
> public class Test extends TestCase {
> public void test1() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer roBuf = cb.asReadOnlyBuffer();
> roBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> public void test2() {
> char[] cc = {'b', 'u', 'f', 'f', 'e', 'r'};
> CharBuffer cb = CharBuffer.wrap(cc);
> try {
> cb.mark();
> CharBuffer dupBuf = cb.duplicate();
> dupBuf.reset();
> fail("InvalidMarkException should be thrown");
> } catch (InvalidMarkException e) {
> //passed
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira