harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3638) [classlib][nio] JNI function GetDirectBufferCapacity() returns 0 on non-byte views of a direct buffer
Date Thu, 12 Apr 2007 15:58:32 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488414

Alexey Varlamov commented on HARMONY-3638:

Ah, I did not realized Sun really fixed this bug in 1.6, though not to the end - there is
another bug [2] in progress.
[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6446635

> [classlib][nio] JNI function GetDirectBufferCapacity() returns 0 on non-byte views of
a direct buffer
> -----------------------------------------------------------------------------------------------------
>                 Key: HARMONY-3638
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3638
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib, Non-bug differences from RI
>            Reporter: Alexey Varlamov
>         Assigned To: Alexey Varlamov
>            Priority: Minor
> The specification of JNI function GetDirectBufferCapacity() reads:
> "Returns the capacity in bytes of the memory region associated with the buffer. Returns
-1 if the given object is not a direct java.nio.Buffer, or if JNI access to direct buffers
is not supported by this virtual machine. "
> However it returns 0 for non-byte views of a direct buffer, i.e. buffers obtained like
> ByteBuffer.allocateDirect(100).asCharBuffer();
> Surprisingly, RI behaves in the same way; I found related bugreport [1] against Sun's
JDK which has really vague evaluation. Briefly, it says that they don't want to spend efforts
fixing this bug untill real use case exists and unaligned view buffers aren't supposed to
work (at least on some architectures like sparc) anyway. How do you like that? ;)
> I see no problem to fix this in Harmony and suppose we should follow the spec here.
> [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4528170

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message