Groups | Blog | Home
all groups > vj# > may 2005 >

vj# : How is java.net.* package implemented in vj#



Babu
5/3/2005 9:17:02 AM
I am converting a vj++ project to vj#.
In my project, I have a class(named java.net.DestroyAddress.java) that calls
AddressCache field from java.net.InetAddress class. I later found out that
AddressCache comes from a native net.dll(it's part of JVM).
Because of this, the project cannot run successfully when converted to vj#.
Will some Microsoft expert who has internal knowledge of how jdk1.1.4 class
libraries are implemented in vj# suggest a solution for me.

Furthermore, I wrote this class DestroyAddress.java to overcome a bug in
jdk's InetAddress class and net.dll(It does some invalid DNS caching). Are
all bugs from JDK's native libraries(like net.dll) imported into jsharp?

Regards
Jennifer-Ashley
5/3/2005 10:15:05 AM
[quoted text, click to view]

There is no such thing as an AddressCache field inside the InetAddress
class. This class only contains methods.
(http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html#method_summary)
Also, the InetAddress class has been around since JVM 1.0, so there shouldn't
be too many discrepancies.

Could you please clarify which method from which class you are referring to.

Babu
5/5/2005 2:26:04 AM

Actually AddressCache is a protected field in InetAddress class. It's loaded
via net.dll.
Here is the source code of InetAddress.java for your reference:
http://www.flex-compiler.lcs.mit.edu/Harpoon/srcdoc/java/net/InetAddress.html

You can see the line number 106 and many other lines where AddressCache is
used. I was able to compile and run my code using AddressCache in vj++ for
years. Now it doesn't work in vj#!!!

Will anyone from Microsoft clarify how java.net.InetAddress is implement in
vj#? Is it exactly same as vj++ and sun jdk1.1.4? It had many bugs like:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4193642

Are those bugs carried over to vj#?

Regards
Babu


[quoted text, click to view]
Pete Loveall
5/5/2005 9:38:56 AM
I can tell you J# is implemented completely without reference to Microsoft's
(or anyone else's) JVM. I have reported (and have had accepted) two bug
reports on J# where they do not even support the basic API.

On the other hand, you are using a non-published (not in the API) protected
field in your code. While it may work under certain circumstances, there
are no guarantees that your code will work across JVM's. In fact, you can
safely assume your code won't work across JVM's if you consider clean-room
JVM's (which, essentially, is what J# is).

Pete Loveall
AME Corp.

[quoted text, click to view]

AddThis Social Bookmark Button