2 messages in net.java.dev.jna.usersRe: [jna-users] Pointer.NULL
FromSent OnAttachments
rzoDec 27, 2008 7:18 am 
Timothy WallDec 27, 2008 8:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Pointer.NULLActions...
From:Timothy Wall (twal@dev.java.net)
Date:Dec 27, 2008 8:56:47 am
List:net.java.dev.jna.users

Pointer(0) is not considered a valid object. JNA substitutes Java null for any zero-valued pointer. Changing JNA internally to additionally consider the more verbose Object.equals comparisons would mean additional complexity for no reasonable benefit.

Pointer.NULL provides a type-based null in case you have a multiply- mapped method signature like this:

void passValue(Pointer) void passValue(int)

On Dec 27, 2008, at 10:21 AM, rzo wrote:

Hello,

currently: Pointer.NULL = null

I think this is misleading.

More appropriate would be

Pointer.NULL = new Pointer(0)

This would allow:

Pointer p = someMethod(); if (Pointer.NULL.equals(p)) sayError();

comments ?