This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.net.InetSocketAddress


Hi list,


I commited the attached patch to make all member variables in 
InetSocketAddress private and to add missing documentation parts.



Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2361
diff -u -b -B -r1.2361 ChangeLog
--- ChangeLog	26 Nov 2003 10:17:49 -0000	1.2361
+++ ChangeLog	26 Nov 2003 10:40:29 -0000
@@ -1,5 +1,19 @@
 2003-11-26  Michael Koch  <konqueror@gmx.de>
 
+	* java/net/InetSocketAddress.java
+	(hostname): Made private, added documentation.
+	(addr): Likewise.
+	(port): Likewise.
+	(equals): Completed documentation.
+	(getAddress): Likewise.
+	(getHostName): Likewise.
+	(getPort): Likewise.
+	(hashCode): Likewise.
+	(isUnresolved): Likewise.
+	(toString): Likewise.
+
+2003-11-26  Michael Koch  <konqueror@gmx.de>
+
 	* gnu/java/net/protocol/file/Handler.java
 	(Handler): New explicit constructor.
 	(openConnection): Added documentation.
Index: java/net/InetSocketAddress.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/InetSocketAddress.java,v
retrieving revision 1.9
diff -u -b -B -r1.9 InetSocketAddress.java
--- java/net/InetSocketAddress.java	2 Oct 2003 19:29:31 -0000	1.9
+++ java/net/InetSocketAddress.java	26 Nov 2003 10:40:29 -0000
@@ -52,9 +52,20 @@
    */
   private static final long serialVersionUID = 5076001401234631237L;
   
-  String hostname;
-  InetAddress addr;
-  int port;
+  /**
+   * Name of host.
+   */
+  private String hostname;
+
+  /**
+   * Address of host.
+   */
+  private InetAddress addr;
+
+  /**
+   * Port of host.
+   */
+  private int port;
     
   /**
    * Constructs an InetSocketAddress instance.
@@ -124,6 +135,10 @@
   /** 
    * Test if obj is a <code>InetSocketAddress</code> and
    * has the same address and port
+   *
+   * @param obj The obj to compare this address with.
+   *
+   * @return True if obj is equal.   
    */
   public final boolean equals (Object obj)
   {
@@ -148,6 +163,8 @@
   /**
    * Returns the <code>InetAddress</code> or
    * <code>null</code> if its unresolved
+   *
+   * @return The IP address of this address.
    */
   public final InetAddress getAddress()
   {
@@ -156,6 +173,8 @@
 
   /**
    * Returns <code>hostname</code>
+   *
+   * @return The hostname of this address.
    */
   public final String getHostName()
   {
@@ -164,6 +183,8 @@
 
   /**
    * Returns the <code>port</code>
+   *
+   * @return The port of this address.
    */
   public final int getPort()
   {
@@ -172,6 +193,8 @@
     
   /**
    * Returns the hashcode of the <code>InetSocketAddress</code>
+   *
+   * @return The hashcode for this address.
    */
   public final int hashCode()
   {
@@ -180,6 +203,8 @@
 
   /**
    * Checks wether the address has been resolved or not
+   *
+   * @return True if address is unresolved.
    */
   public final boolean isUnresolved()
   {
@@ -188,6 +213,8 @@
     
   /**
    * Returns the <code>InetSocketAddress</code> as string
+   *
+   * @return A string represenation of this address.
    */
   public String toString()
   {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]