harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r428265 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/InetSocketAddress.java test/java/tests/api/java/net/InetSocketAddressTest.java
Date Thu, 03 Aug 2006 07:04:01 GMT
Author: pyang
Date: Thu Aug  3 00:04:01 2006
New Revision: 428265

URL: http://svn.apache.org/viewvc?rev=428265&view=rev
Log:
Fix for HARMONY-1042 ([classlib][luni] java.net.InetSocketAddress.getHostName() returns null
if it is created by ip address.)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetSocketAddress.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetSocketAddressTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetSocketAddress.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetSocketAddress.java?rev=428265&r1=428264&r2=428265&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetSocketAddress.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetSocketAddress.java
Thu Aug  3 00:04:01 2006
@@ -90,7 +90,7 @@
 	}
 
 	public final String getHostName() {
-        return (null != addr) ? addr.hostName : hostname;
+        return (null != addr) ? addr.getHostName() : hostname;
     }
 
 	public final boolean isUnresolved() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetSocketAddressTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetSocketAddressTest.java?rev=428265&r1=428264&r2=428265&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetSocketAddressTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetSocketAddressTest.java
Thu Aug  3 00:04:01 2006
@@ -27,6 +27,15 @@
     private static final String SERIALIZATION_FILE_NAME_UNRESOLVED = "serialization/java/net/InetSocketAddress.golden.2.ser";
 
     /**
+     * @tests java.net.InetSocketAddress#InetSocketAddress(String, int)
+     */
+    public void test_ConstructorLjava_lang_StringI() throws Exception {
+        // regression test for Harmony-1042
+        InetSocketAddress address = new InetSocketAddress("127.0.0.1", 0);
+        assertNotNull(address.getHostName());
+    }
+    
+    /**
 	 * @tests java.net.InetSocketAddress#createUnresolved(String, int)
 	 */
 	public void test_createUnresolvedLjava_lang_StringI() {



Mime
View raw message