diff options
Diffstat (limited to 'libjava/classpath/vm/reference/java/net')
-rw-r--r-- | libjava/classpath/vm/reference/java/net/VMInetAddress.java | 19 | ||||
-rw-r--r-- | libjava/classpath/vm/reference/java/net/VMURLConnection.java | 7 |
2 files changed, 15 insertions, 11 deletions
diff --git a/libjava/classpath/vm/reference/java/net/VMInetAddress.java b/libjava/classpath/vm/reference/java/net/VMInetAddress.java index a99c216b96c..97ae09a743a 100644 --- a/libjava/classpath/vm/reference/java/net/VMInetAddress.java +++ b/libjava/classpath/vm/reference/java/net/VMInetAddress.java @@ -1,5 +1,5 @@ /* VMInetAddress.java -- Class to model an Internet address - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,16 +40,17 @@ package java.net; import gnu.classpath.Configuration; -import java.io.Serializable; - -class VMInetAddress implements Serializable +final class VMInetAddress { + static { if (Configuration.INIT_LOAD_LIBRARY) System.loadLibrary("javanet"); } + private VMInetAddress() {} // Prohibits instantiation. + /** * This method looks up the hostname of the local machine * we are on. If the actual hostname cannot be determined, then the @@ -58,12 +59,12 @@ class VMInetAddress implements Serializable * * @return The local hostname. */ - public static native String getLocalHostname(); + static native String getLocalHostname(); /** * Returns the value of the special address INADDR_ANY */ - public static native byte[] lookupInaddrAny() throws UnknownHostException; + static native byte[] lookupInaddrAny() throws UnknownHostException; /** * This method returns the hostname for a given IP address. It will @@ -75,14 +76,14 @@ class VMInetAddress implements Serializable * * @exception UnknownHostException If the reverse lookup fails */ - public static native String getHostByAddr(byte[] ip) + static native String getHostByAddr(byte[] ip) throws UnknownHostException; /** * Returns a list of all IP addresses for a given hostname. Will throw * an UnknownHostException if the hostname cannot be resolved. */ - public static native byte[][] getHostByName(String hostname) + static native byte[][] getHostByName(String hostname) throws UnknownHostException; /** @@ -93,5 +94,5 @@ class VMInetAddress implements Serializable * * @return The IP address as a byte array */ - public static native byte[] aton(String address); + static native byte[] aton(String address); } diff --git a/libjava/classpath/vm/reference/java/net/VMURLConnection.java b/libjava/classpath/vm/reference/java/net/VMURLConnection.java index 19bf5814e67..ae04bdb6a05 100644 --- a/libjava/classpath/vm/reference/java/net/VMURLConnection.java +++ b/libjava/classpath/vm/reference/java/net/VMURLConnection.java @@ -1,5 +1,5 @@ /* VMURLConnection - VM code for URLConnection - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,7 +45,8 @@ import java.io.InputStream; final class VMURLConnection { - public static final int LENGTH = 1024; + + static final int LENGTH = 1024; static { @@ -54,6 +55,8 @@ final class VMURLConnection init(); } + private VMURLConnection() {} // Prohibits instantiation. + private static native void init(); private static native String guessContentTypeFromBuffer(byte[] b, int valid); |