You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2007/06/23 22:53:48 UTC

svn commit: r550106 [13/16] - in /harmony/enhanced/classlib/branches/java6/modules: beans/src/main/java/java/beans/ jndi/META-INF/ jndi/src/main/java/javax/naming/ jndi/src/main/java/javax/naming/directory/ jndi/src/main/java/javax/naming/event/ jndi/s...

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContextFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContextFactory.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContextFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContextFactory.java Sat Jun 23 13:53:42 2007
@@ -30,8 +30,6 @@
 
 /**
  * A factory to build DNS contexts.
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  */
 public class DNSContextFactory implements InitialContextFactory {
 
@@ -45,11 +43,13 @@
     /**
      * Creates a new instance of DNS context.
      * 
-     * @param env an environment to be used
+     * @param env
+     *            an environment to be used
      * @return new instance of <code>DNSContext</code>
      * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable)
      */
-    public Context getInitialContext(Hashtable<?, ?> env) throws NamingException {
+    public Context getInitialContext(Hashtable<?, ?> env)
+            throws NamingException {
         return new DNSContext(env);
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSName.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSName.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSName.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSName.java Sat Jun 23 13:53:42 2007
@@ -24,28 +24,24 @@
 package org.apache.harmony.jndi.provider.dns;
 
 import java.util.Enumeration;
-import java.util.Vector;
-//import java.util.logging.Level;
+import java.util.Vector; // import java.util.logging.Level;
 import javax.naming.InvalidNameException;
 import javax.naming.Name;
 
 import org.apache.harmony.jndi.internal.nls.Messages;
 
-
 /**
  * Represents the name in Domain Name System. The most significant part is the
  * rightmost part of string representation.
  * 
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  * TODO add escapes checking for name components (?)
  */
 public class DNSName implements Name, Cloneable {
 
     private static final long serialVersionUID = -5931312723719884197L;
-    
+
     private Vector<String> components;
-    
+
     /**
      * Constructs an empty DNS name.
      */
@@ -57,7 +53,8 @@
     /**
      * Constructs new DNS name with given components.
      * 
-     * @param compVect the vector of name components
+     * @param compVect
+     *            the vector of name components
      */
     DNSName(Vector<String> compVect) {
         components = compVect;
@@ -80,8 +77,8 @@
     }
 
     /**
-     * @return <code>true</code> if this name is an absolute DNS name,
-     *  i.e. starts with empty label 
+     * @return <code>true</code> if this name is an absolute DNS name, i.e.
+     *         starts with empty label
      */
     public boolean isAbsolute() {
         if (components.size() > 0) {
@@ -96,6 +93,7 @@
 
     /**
      * Returns clone of the current name.
+     * 
      * @see java.lang.Object#clone()
      */
     @Override
@@ -111,9 +109,11 @@
 
     /**
      * Removes component with specified number.
-     * @param posn index of component to remove
-     * @throws ArrayIndexOutOfBoundsException if <code>posn</code> index is
-     *  out of range 
+     * 
+     * @param posn
+     *            index of component to remove
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>posn</code> index is out of range
      * @see javax.naming.Name#remove(int)
      */
     public Object remove(int posn) throws InvalidNameException {
@@ -121,18 +121,21 @@
     }
 
     /**
-     * Compares the specified name with the current name. It checks all components
-     * beginning at the most significant one. The method
-     *  <code>compareToIgnoreCase</code>
-     * of underlying <code>String</code> object will be used for the real
-     * comparison of components.
-     * If two names have different sizes and the longer name begins with
-     * the shorter name then the longer name will be "bigger" than shorter.
-     * @param name the name to compare with
+     * Compares the specified name with the current name. It checks all
+     * components beginning at the most significant one. The method
+     * <code>compareToIgnoreCase</code> of underlying <code>String</code>
+     * object will be used for the real comparison of components. If two names
+     * have different sizes and the longer name begins with the shorter name
+     * then the longer name will be "bigger" than shorter.
+     * 
+     * @param name
+     *            the name to compare with
      * @return negative number; zero or positive number
-     * @throws ClassCastException if the <code>name</code> has class other than
-     * <code>DNSName</code>
-     * @throws NullPointerException if the <code>name</code> is null
+     * @throws ClassCastException
+     *             if the <code>name</code> has class other than
+     *             <code>DNSName</code>
+     * @throws NullPointerException
+     *             if the <code>name</code> is null
      * @see javax.naming.Name#compareTo(java.lang.Object)
      * @see java.lang.String#compareToIgnoreCase(java.lang.String)
      */
@@ -173,18 +176,20 @@
     }
 
     /**
-     * @param posn index of the component to return
-     * @return name component at index <code>posn</code> 
-     * @throws ArrayIndexOutOfBoundsException if <code>posn</code> index is
-     *  out of range 
+     * @param posn
+     *            index of the component to return
+     * @return name component at index <code>posn</code>
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>posn</code> index is out of range
      * @see javax.naming.Name#get(int)
      */
     public String get(int posn) {
-        return components.elementAt(posn); 
+        return components.elementAt(posn);
     }
 
     /**
      * Returns all components of the current name.
+     * 
      * @return enumeration of strings
      * @see javax.naming.Name#getAll()
      */
@@ -193,12 +198,13 @@
     }
 
     /**
-     * @param posn index to stop at
-     * @return a <code>DNSName</code> object that consists of components of the
-     * current name with indexes from <code>0</code> to and not including
-     *  <code>posn</code>.
-     * @throws ArrayIndexOutOfBoundsException if <code>posn</code> index is
-     *  out of range 
+     * @param posn
+     *            index to stop at
+     * @return a <code>DNSName</code> object that consists of components of
+     *         the current name with indexes from <code>0</code> to and not
+     *         including <code>posn</code>.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>posn</code> index is out of range
      * @see javax.naming.Name#getPrefix(int)
      */
     public Name getPrefix(int posn) {
@@ -211,12 +217,13 @@
     }
 
     /**
-     * @param posn index to start at
-     * @return a <code>DNSName</code> object that consists of components of the
-     * current name with indexes from <code>posn</code> to and not including
-     *  <code>#size()</code>.
-     * @throws ArrayIndexOutOfBoundsException if <code>posn</code> index is
-     *  out of range 
+     * @param posn
+     *            index to start at
+     * @return a <code>DNSName</code> object that consists of components of
+     *         the current name with indexes from <code>posn</code> to and not
+     *         including <code>#size()</code>.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>posn</code> index is out of range
      * @see javax.naming.Name#getSuffix(int)
      */
     public Name getSuffix(int posn) {
@@ -232,7 +239,9 @@
      * Checks if the current name ends with the given name. Returns
      * <code>false</code> if the given name is <code>null</code> or not an
      * instance of <code>DNSName</code> class.
-     * @param name the name to compare the end of the current message with
+     * 
+     * @param name
+     *            the name to compare the end of the current message with
      * @return <code>true</code> or <code>false</code>
      * @see javax.naming.Name#endsWith(javax.naming.Name)
      */
@@ -254,10 +263,9 @@
                 k = this.compareTo(name);
             } catch (ClassCastException e) {
                 // impossible case
-                //ProviderMgr.logger.log(Level.SEVERE, "impossible case", e);
+                // ProviderMgr.logger.log(Level.SEVERE, "impossible case", e);
             }
-        }
-        else if (len1 > len2) {
+        } else if (len1 > len2) {
             Name suffix = this.getSuffix(len1 - len2);
 
             k = suffix.compareTo(name);
@@ -269,7 +277,9 @@
      * Checks if the current name starts with the given name. Returns
      * <code>false</code> if the given name is <code>null</code> or not an
      * instance of <code>DNSName</code> class.
-     * @param name the name to compare the beginning of the current message with
+     * 
+     * @param name
+     *            the name to compare the beginning of the current message with
      * @return <code>true</code> or <code>false</code>
      * @see javax.naming.Name#startsWith(javax.naming.Name)
      */
@@ -293,8 +303,7 @@
                 // impossible case
                 // ProviderMgr.logger.log(Level.SEVERE, "impossible error", e);
             }
-        }
-        else if (len1 > len2) {
+        } else if (len1 > len2) {
             Name prefix = this.getPrefix(len2);
 
             k = prefix.compareTo(name);
@@ -304,14 +313,17 @@
 
     /**
      * Adds the given component to the list of components at the specified
-     *  index.
-     * @param posn an index to insert at
-     * @param comp the component to insert
+     * index.
+     * 
+     * @param posn
+     *            an index to insert at
+     * @param comp
+     *            the component to insert
      * @return updated name (<code>this</code> object)
-     * @throws InvalidNameException if the given string can't be used as a
-     *  DNS name component 
-     * @throws ArrayIndexOutOfBoundsException if <code>posn</code> index is
-     *  out of range 
+     * @throws InvalidNameException
+     *             if the given string can't be used as a DNS name component
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>posn</code> index is out of range
      * @see javax.naming.Name#add(int, java.lang.String)
      */
     public Name add(int posn, String comp) throws InvalidNameException {
@@ -325,15 +337,17 @@
 
     /**
      * Adds the given component to the end of the current name.
-     * @param comp the component to insert
+     * 
+     * @param comp
+     *            the component to insert
      * @return updated name (<code>this</code> object)
-     * @throws InvalidNameException if the given string can't be used as a
-     *  DNS name component 
+     * @throws InvalidNameException
+     *             if the given string can't be used as a DNS name component
      * @see javax.naming.Name#add(java.lang.String)
      */
     public Name add(String comp) throws InvalidNameException {
         if (!componentIsOk(comp)) {
-            // jndi.30={0} can't be used as a component for DNS name 
+            // jndi.30={0} can't be used as a component for DNS name
             throw new InvalidNameException(Messages.getString("jndi.30", comp));//$NON-NLS-1$
         }
         components.addElement(comp);
@@ -342,11 +356,15 @@
 
     /**
      * Add given components to the current name. The order is preserved.
-     * @param posn the index at which given components should be added 
-     * @param name components this name should be added
+     * 
+     * @param posn
+     *            the index at which given components should be added
+     * @param name
+     *            components this name should be added
      * @return <code>this</code> object
-     * @throws InvalidNameException if the name given is not an instance of
-     *  <code>DNSName</code> class
+     * @throws InvalidNameException
+     *             if the name given is not an instance of <code>DNSName</code>
+     *             class
      * @see javax.naming.Name#addAll(int, javax.naming.Name)
      */
     public Name addAll(int posn, Name name) throws InvalidNameException {
@@ -363,10 +381,13 @@
 
     /**
      * Add given components to the end of current name. The order is preserved.
-     * @param name components this name should be added
+     * 
+     * @param name
+     *            components this name should be added
      * @return <code>this</code> object
-     * @throws InvalidNameException if the name given is not an instance of
-     *  <code>DNSName</code> class
+     * @throws InvalidNameException
+     *             if the name given is not an instance of <code>DNSName</code>
+     *             class
      * @see javax.naming.Name#addAll(javax.naming.Name)
      */
     public Name addAll(Name name) throws InvalidNameException {
@@ -383,13 +404,13 @@
 
     /**
      * Returns the string representation of this DNS name.
+     * 
      * @return DNS name in string form
      */
     @Override
     public String toString() {
         StringBuffer sb = new StringBuffer();
 
-        
         for (int i = components.size() - 1; i >= 0; i--) {
             String comp = components.elementAt(i);
             if (sb.length() > 0 || i == 0) {
@@ -401,16 +422,17 @@
         }
         return sb.toString();
     }
-    
+
     /**
      * Checks if the given string is a correct DNS name component.
-     * @param comp the string component to check
+     * 
+     * @param comp
+     *            the string component to check
      * @return <code>true</code> or <code>false</code>
      */
     static boolean componentIsOk(String comp) {
         if (comp.indexOf(".") != -1 || comp.length() > //$NON-NLS-1$
-                ProviderConstants.LABEL_MAX_CHARS)
-        {
+                ProviderConstants.LABEL_MAX_CHARS) {
             return false;
         }
         return true;

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSNameParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSNameParser.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSNameParser.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSNameParser.java Sat Jun 23 13:53:42 2007
@@ -32,15 +32,14 @@
 
 /**
  * DNS name parser
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  */
 public class DNSNameParser implements NameParser {
 
     /**
      * Constructs a new name parser.
      */
-    public DNSNameParser() {}
+    public DNSNameParser() {
+    }
 
     /**
      * Parses string representation of DNS name. Following situations will be
@@ -49,11 +48,14 @@
      * <li>The length of the whole name is longer than 255 characters</li>
      * <li>The length of each label is more than 63 characters</li>
      * <li>more than one null label encountered or null label is not the least
-     * specific label (the rightmost)</li> 
+     * specific label (the rightmost)</li>
      * </ul>
-     * @param name string representation of DNS name
+     * 
+     * @param name
+     *            string representation of DNS name
      * @return new instance of <code>DNSName</code> class
-     * @throws InvalidNameException if given string is not a correct DNS name
+     * @throws InvalidNameException
+     *             if given string is not a correct DNS name
      * @see javax.naming.NameParser#parse(java.lang.String)
      * @see RFC 1034
      */
@@ -78,20 +80,21 @@
                 if (lastTokenWasDilim) {
                     // two delimiters one after another
                     // jndi.55=Null label is not the rightmost one
-                    throw new InvalidNameException(
-                            Messages.getString("jndi.55")); //$NON-NLS-1$
+                    throw new InvalidNameException(Messages
+                            .getString("jndi.55")); //$NON-NLS-1$
                 }
                 lastTokenWasDilim = true;
                 if (dnsName.size() == 0 && st.hasMoreTokens()) {
                     // jndi.56=DNS name shouldn't start with a dot
-                    throw new InvalidNameException(Messages.getString("jndi.56")); //$NON-NLS-1$
+                    throw new InvalidNameException(Messages
+                            .getString("jndi.56")); //$NON-NLS-1$
                 }
-            }
-            else {
+            } else {
                 if (comp.length() > 63) {
-                    // jndi.57=The length of {0} label is more than 63 characters
-                    throw new InvalidNameException(
-                            Messages.getString("jndi.57", comp)); //$NON-NLS-1$
+                    // jndi.57=The length of {0} label is more than 63
+                    // characters
+                    throw new InvalidNameException(Messages.getString(
+                            "jndi.57", comp)); //$NON-NLS-1$
                 }
                 dnsName.add(0, comp);
                 lastTokenWasDilim = false;
@@ -104,9 +107,11 @@
     }
 
     /**
-     * @param obj the object to compare with
-     * @return <code>true</code> if and only if the given object is instance of
-     * class <code>DNSParser</code>; otherwise returns <code>false</code>.
+     * @param obj
+     *            the object to compare with
+     * @return <code>true</code> if and only if the given object is instance
+     *         of class <code>DNSParser</code>; otherwise returns
+     *         <code>false</code>.
      */
     @Override
     public boolean equals(Object obj) {
@@ -115,4 +120,5 @@
         }
         return false;
     }
+
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURL.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURL.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURL.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURL.java Sat Jun 23 13:53:42 2007
@@ -29,14 +29,15 @@
 
 /**
  * Represents a DNS pseudo URL.
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  */
 public class DNSPseudoURL {
 
     private String host = "localhost"; //$NON-NLS-1$
+
     private int port = ProviderConstants.DEFAULT_DNS_PORT;
+
     private String domain = "."; //$NON-NLS-1$
+
     private boolean hostIpWasGiven = false;
 
     /**
@@ -45,16 +46,17 @@
      * <code>dns:[//host[:port]][/domain]</code><br>
      * If no host information was given then <code>localhost</code> will be
      * used. If no port was given then the standard DNS server port
-     * <code>53</code> will be used. If no domain was given then the root domain
-     * will be used. All domain here are treated as absolute domains.
-     * @param DNS string representation of DNS URL 
-     * @throws IllegalArgumentException if the argument is not in acceptable
-     * format
-     * @throws NullPointerException if the argument is null 
+     * <code>53</code> will be used. If no domain was given then the root
+     * domain will be used. All domain here are treated as absolute domains.
+     * 
+     * @param DNS
+     *            string representation of DNS URL
+     * @throws IllegalArgumentException
+     *             if the argument is not in acceptable format
+     * @throws NullPointerException
+     *             if the argument is null
      */
-    public DNSPseudoURL(String strForm) throws IllegalArgumentException
-    
-    {
+    public DNSPseudoURL(String strForm) throws IllegalArgumentException {
         StringTokenizer st = null;
         StringTokenizer st2 = null;
         String token;
@@ -77,16 +79,18 @@
         // host
         if (st.hasMoreTokens()) {
             token = st.nextToken();
-            if (!token.equals("/") || !st.hasMoreTokens()) {  //$NON-NLS-1$
+            if (!token.equals("/") || !st.hasMoreTokens()) { //$NON-NLS-1$
                 // jndi.6A=Bad URL syntax
-                throw new IllegalArgumentException(Messages.getString("jndi.6A")); //$NON-NLS-1$
+                throw new IllegalArgumentException(Messages
+                        .getString("jndi.6A")); //$NON-NLS-1$
             }
             token = st.nextToken();
             if (token.equals("/")) { //$NON-NLS-1$
                 // host[:port] was given
                 if (!st.hasMoreElements()) {
                     // jndi.6A=Bad URL syntax
-                    throw new IllegalArgumentException(Messages.getString("jndi.6A")); //$NON-NLS-1$
+                    throw new IllegalArgumentException(Messages
+                            .getString("jndi.6A")); //$NON-NLS-1$
                 }
                 token = st.nextToken();
                 st2 = new StringTokenizer(token, ":"); //$NON-NLS-1$
@@ -106,7 +110,8 @@
                     token = st.nextToken();
                     if (!token.equals("/") || !st.hasMoreTokens()) { //$NON-NLS-1$
                         // jndi.6A=Bad URL syntax
-                        throw new IllegalArgumentException(Messages.getString("jndi.6A")); //$NON-NLS-1$
+                        throw new IllegalArgumentException(Messages
+                                .getString("jndi.6A")); //$NON-NLS-1$
                     }
                     domain = ProviderMgr.normalizeName(st.nextToken());
                 }
@@ -117,8 +122,8 @@
             // extra
             if (st.hasMoreTokens()) {
                 // jndi.66=Extra characters encountered at the end of the URL
-                throw new IllegalArgumentException(
-                        Messages.getString("jndi.66")); //$NON-NLS-1$
+                throw new IllegalArgumentException(Messages
+                        .getString("jndi.66")); //$NON-NLS-1$
             }
         }
     }
@@ -129,22 +134,26 @@
     public String getDomain() {
         return domain;
     }
+
     /**
      * @return Returns the host.
      */
     public String getHost() {
         return host;
     }
+
     /**
      * @return Returns the hostIpWasGiven.
      */
     public boolean isHostIpGiven() {
         return hostIpWasGiven;
     }
+
     /**
      * @return Returns the port.
      */
     public int getPort() {
         return port;
     }
+
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DomainProtocolException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DomainProtocolException.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DomainProtocolException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DomainProtocolException.java Sat Jun 23 13:53:42 2007
@@ -26,15 +26,12 @@
 import javax.naming.NamingException;
 
 /**
- * The exception that can be thrown from the DNS Resolver classes. 
- * 
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
+ * The exception that can be thrown from the DNS Resolver classes.
  */
 public class DomainProtocolException extends NamingException {
-    
+
     private static final long serialVersionUID = -6631370496197297208L;
-    
+
     public DomainProtocolException(String message) {
         super(message);
     }
@@ -43,9 +40,10 @@
         super();
         setRootCause(cause);
     }
-    
+
     public DomainProtocolException(String mes, Exception cause) {
         super(mes);
         setRootCause(cause);
     }
+
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/Message.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/Message.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/Message.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/Message.java Sat Jun 23 13:53:42 2007
@@ -23,7 +23,6 @@
 
 package org.apache.harmony.jndi.provider.dns;
 
-
 import java.util.Vector;
 import java.util.Enumeration;
 
@@ -32,14 +31,12 @@
 /**
  * This class represents a domain protocol message.
  * 
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  * @see RFC 1035
  */
 public class Message {
-    
+
     // header section fields
-    
+
     /** an ID */
     private int id = 0;
 
@@ -47,41 +44,43 @@
     private boolean qr = ProviderConstants.QR_QUERY;
 
     /** OPCODE; QUERY or IQUERY or STATUS */
-    private int opCode = 0; 
+    private int opCode = 0;
 
-    /** AA, Authoritative Answer*/
-    private boolean aa = false; 
+    /** AA, Authoritative Answer */
+    private boolean aa = false;
 
     /** TC, TrunCation */
-    private boolean tc = false; 
+    private boolean tc = false;
 
     /** RD, Recursion Desired */
-    private boolean rd = false; 
+    private boolean rd = false;
 
     /** RA, Recursion Available */
-    private boolean ra = false; 
+    private boolean ra = false;
 
     /** Z, always should be zero */
-    //private int z; 
-
+    // private int z;
     /** RCODE, Response CODE */
-    private int rCode = 0; 
+    private int rCode = 0;
 
     /** QDCOUNT, number of records in question section */
-    private int qdCount = 0; 
+    private int qdCount = 0;
 
     /** ANCOUNT, number of records in answer section */
-    private int anCount = 0; 
+    private int anCount = 0;
 
     /** NSCOUNT, number of records in authority records section */
-    private int nsCount = 0; 
+    private int nsCount = 0;
 
     /** ARCOUNT, number of records in additional section */
     private int arCount = 0;
 
     private Vector<QuestionRecord> questionRecords = null;
+
     private Vector<ResourceRecord> answerRRs = null;
+
     private Vector<ResourceRecord> authorityRRs = null;
+
     private Vector<ResourceRecord> additionalRRs = null;
 
     /** */
@@ -92,36 +91,37 @@
         additionalRRs = new Vector<ResourceRecord>();
     }
 
-    /** 
-     * Constructs Message object from given parameters 
-     *
-     * @param id ID
-     * @param qr QR
-     * @param opCode OPCODE
-     * @param aa AA
-     * @param tc TC
-     * @param rd RA
-     * @param ra RA
-     * @param rCode RCODE
-     * @param qdCount QDCOUNT
-     * @param anCount ANCOUNT
-     * @param nsCount NSCOUNT
-     * @param arCount ARCOUNT
-     */
-    public Message(
-            int id,
-            boolean qr,
-            int opCode, 
-            boolean aa, 
-            boolean tc, 
-            boolean rd, 
-            boolean ra, 
-            int rCode, 
-            int qdCount, 
-            int anCount, 
-            int nsCount, 
-            int arCount)
-    {
+    /**
+     * Constructs Message object from given parameters
+     * 
+     * @param id
+     *            ID
+     * @param qr
+     *            QR
+     * @param opCode
+     *            OPCODE
+     * @param aa
+     *            AA
+     * @param tc
+     *            TC
+     * @param rd
+     *            RA
+     * @param ra
+     *            RA
+     * @param rCode
+     *            RCODE
+     * @param qdCount
+     *            QDCOUNT
+     * @param anCount
+     *            ANCOUNT
+     * @param nsCount
+     *            NSCOUNT
+     * @param arCount
+     *            ARCOUNT
+     */
+    public Message(int id, boolean qr, int opCode, boolean aa, boolean tc,
+            boolean rd, boolean ra, int rCode, int qdCount, int anCount,
+            int nsCount, int arCount) {
         this.id = id;
         this.qr = qr;
         this.opCode = opCode;
@@ -139,18 +139,20 @@
         authorityRRs = new Vector<ResourceRecord>();
         additionalRRs = new Vector<ResourceRecord>();
     }
-    
+
     /**
-     * Generates sequence of bytes that represents the message. 
+     * Generates sequence of bytes that represents the message.
      * 
-     * @param buffer the buffer to write bytes into
-     * @param startIdx the index of <code>buffer</code> to start writing at
+     * @param buffer
+     *            the buffer to write bytes into
+     * @param startIdx
+     *            the index of <code>buffer</code> to start writing at
      * @return updated index of the <code>buffer</code>
-     * @throws DomainProtocolException if something went wrong
+     * @throws DomainProtocolException
+     *             if something went wrong
      */
     public int writeBytes(byte[] buffer, int startIdx)
-            throws DomainProtocolException
-    {
+            throws DomainProtocolException {
         int idx = startIdx;
         int tmp = 0;
 
@@ -219,16 +221,19 @@
     /**
      * Parses given sequence of bytes and constructs a message object from it.
      * 
-     * @param mesBytes the byte array that should be parsed
-     * @param startIdx an index of <code>mesBytes</code> array to start the
-     *  parsing at
-     * @param mes an object to write a result to, should already be created
+     * @param mesBytes
+     *            the byte array that should be parsed
+     * @param startIdx
+     *            an index of <code>mesBytes</code> array to start the parsing
+     *            at
+     * @param mes
+     *            an object to write a result to, should already be created
      * @return updated index of <code>mesBytes</code> array
-     * @throws DomainProtocolException if some error has occured
+     * @throws DomainProtocolException
+     *             if some error has occurred
      */
-    public static int parseMessage(byte[] mesBytes, int startIdx,
-            Message mesObj) throws DomainProtocolException
-    {
+    public static int parseMessage(byte[] mesBytes, int startIdx, Message mesObj)
+            throws DomainProtocolException {
         int idx = startIdx;
         int tmp, tmp2;
         int qdCnt;
@@ -250,8 +255,7 @@
         // QR
         mesObj.setQR(ProviderMgr.checkBit(tmp, ProviderConstants.QR_MASK));
         // OPCODE
-        tmp2 = (tmp & ProviderConstants.OPCODE_MASK)
-                        >> ProviderConstants.OPCODE_SHIFT; 
+        tmp2 = (tmp & ProviderConstants.OPCODE_MASK) >> ProviderConstants.OPCODE_SHIFT;
         mesObj.setOpCode(tmp2);
         // AA
         mesObj.setAA(ProviderMgr.checkBit(tmp, ProviderConstants.AA_MASK));
@@ -262,8 +266,7 @@
         // RA
         mesObj.setRA(ProviderMgr.checkBit(tmp, ProviderConstants.RA_MASK));
         // RCODE
-        tmp2 = (tmp & ProviderConstants.RCODE_MASK)
-                        >> ProviderConstants.RCODE_SHIFT; 
+        tmp2 = (tmp & ProviderConstants.RCODE_MASK) >> ProviderConstants.RCODE_SHIFT;
         mesObj.setRCode(tmp2);
         // QDCOUNT
         qdCnt = ProviderMgr.parse16Int(mesBytes, idx);
@@ -309,199 +312,233 @@
     }
 
     /**
-     * @return string representation of this message 
+     * @return string representation of this message
      */
     @Override
+    @SuppressWarnings("nls")
     public String toString() {
         StringBuffer sb = new StringBuffer();
 
-        sb.append("ID=" + id + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+        sb.append("ID=" + id + "\n");
         if (qr) {
-            sb.append(" QR"); //$NON-NLS-1$
+            sb.append(" QR");
         }
-        sb.append(" OPCODE=" + opCode); //$NON-NLS-1$
+        sb.append(" OPCODE=" + opCode);
         if (aa) {
-            sb.append(" AA"); //$NON-NLS-1$
+            sb.append(" AA");
         }
         if (tc) {
-            sb.append(" TC"); //$NON-NLS-1$
+            sb.append(" TC");
         }
         if (rd) {
-            sb.append(" RD"); //$NON-NLS-1$
+            sb.append(" RD");
         }
         if (ra) {
-            sb.append(" RA"); //$NON-NLS-1$
+            sb.append(" RA");
         }
-        sb.append(" RCODE=" + rCode); //$NON-NLS-1$
-        sb.append("\n"); //$NON-NLS-1$
-        sb.append("QDCOUNT=" + qdCount); //$NON-NLS-1$
+        sb.append(" RCODE=" + rCode);
+        sb.append("\n");
+        sb.append("QDCOUNT=" + qdCount);
         for (int i = 0; i < questionRecords.size(); i++) {
-            sb.append("\n"); //$NON-NLS-1$
+            sb.append("\n");
             sb.append(questionRecords.elementAt(i).toString());
         }
-        sb.append("\n"); //$NON-NLS-1$
-        sb.append(" ANCOUNT=" + anCount); //$NON-NLS-1$
+        sb.append("\n");
+        sb.append(" ANCOUNT=" + anCount);
         for (int i = 0; i < answerRRs.size(); i++) {
-            sb.append("\n"); //$NON-NLS-1$
+            sb.append("\n");
             sb.append(answerRRs.elementAt(i).toString());
         }
-        sb.append("\n"); //$NON-NLS-1$
-        sb.append(" NSCOUNT=" + nsCount); //$NON-NLS-1$
+        sb.append("\n");
+        sb.append(" NSCOUNT=" + nsCount);
         for (int i = 0; i < authorityRRs.size(); i++) {
-            sb.append("\n"); //$NON-NLS-1$
+            sb.append("\n");
             sb.append(authorityRRs.elementAt(i).toString());
         }
-        sb.append("\n"); //$NON-NLS-1$
-        sb.append(" ARCOUNT=" + arCount); //$NON-NLS-1$
+        sb.append("\n");
+        sb.append(" ARCOUNT=" + arCount);
         for (int i = 0; i < additionalRRs.size(); i++) {
-            sb.append("\n"); //$NON-NLS-1$
+            sb.append("\n");
             sb.append(additionalRRs.elementAt(i).toString());
         }
         return sb.toString();
     }
 
-    // setters and getters
-    
     /**
      * @return Returns the AA.
      */
     public boolean isAA() {
         return aa;
     }
+
     /**
-     * @param aa The AA to set.
+     * @param aa
+     *            The AA to set.
      */
     public void setAA(boolean aa) {
         this.aa = aa;
     }
+
     /**
      * @return Returns the anCount.
      */
     public int getANCount() {
         return anCount;
     }
+
     /**
-     * @param anCount The anCount to set.
+     * @param anCount
+     *            The anCount to set.
      */
     public void setANCount(int anCount) {
         this.anCount = anCount;
     }
+
     /**
      * @return Returns the arCount.
      */
     public int getARCount() {
         return arCount;
     }
+
     /**
-     * @param arCount The arCount to set.
+     * @param arCount
+     *            The arCount to set.
      */
     public void setARCount(int arCount) {
         this.arCount = arCount;
     }
+
     /**
      * @return Returns the id.
      */
     public int getId() {
         return id;
     }
+
     /**
-     * @param id The id to set.
+     * @param id
+     *            The id to set.
      */
     public void setId(int id) {
         this.id = id;
     }
+
     /**
      * @return Returns the nsCount.
      */
     public int getNSCount() {
         return nsCount;
     }
+
     /**
-     * @param nsCount The nsCount to set.
+     * @param nsCount
+     *            The nsCount to set.
      */
     public void setNSCount(int nsCount) {
         this.nsCount = nsCount;
     }
+
     /**
      * @return Returns the opCode.
      */
     public int getOpCode() {
         return opCode;
     }
+
     /**
-     * @param opCode The opCode to set.
+     * @param opCode
+     *            The opCode to set.
      */
     public void setOpCode(int opCode) {
         this.opCode = opCode;
     }
+
     /**
      * @return Returns the qdCount.
      */
     public int getQDCount() {
         return qdCount;
     }
+
     /**
-     * @param qdCount The qdCount to set.
+     * @param qdCount
+     *            The qdCount to set.
      */
     public void setQDCount(int qdCount) {
         this.qdCount = qdCount;
     }
+
     /**
      * @return Returns the QR.
      */
     public boolean getQR() {
         return qr;
     }
+
     /**
-     * @param qr The QR to set.
+     * @param qr
+     *            The QR to set.
      */
     public void setQR(boolean qr) {
         this.qr = qr;
     }
+
     /**
      * @return Returns the RA.
      */
     public boolean isRA() {
         return ra;
     }
+
     /**
-     * @param ra The RA to set.
+     * @param ra
+     *            The RA to set.
      */
     public void setRA(boolean ra) {
         this.ra = ra;
     }
+
     /**
      * @return Returns the rCode.
      */
     public int getRCode() {
         return rCode;
     }
+
     /**
-     * @param code The rCode to set.
+     * @param code
+     *            The rCode to set.
      */
     public void setRCode(int code) {
         rCode = code;
     }
+
     /**
      * @return Returns the RD.
      */
     public boolean isRD() {
         return rd;
     }
+
     /**
-     * @param rd The RD to set.
+     * @param rd
+     *            The RD to set.
      */
     public void setRD(boolean rd) {
         this.rd = rd;
     }
+
     /**
      * @return Returns the TC.
      */
     public boolean isTc() {
         return tc;
     }
+
     /**
-     * @param tc The TC to set.
+     * @param tc
+     *            The TC to set.
      */
     public void setTc(boolean tc) {
         this.tc = tc;
@@ -513,10 +550,12 @@
     public Enumeration<QuestionRecord> getQuestionRecords() {
         return questionRecords.elements();
     }
-    
+
     /**
      * Adds a new question record to the message.
-     * @param qr a record to add
+     * 
+     * @param qr
+     *            a record to add
      */
     public void addQuestionRecord(QuestionRecord qr) {
         questionRecords.addElement(qr);
@@ -531,7 +570,9 @@
 
     /**
      * Adds a new question record to the message.
-     * @param rr a record to add
+     * 
+     * @param rr
+     *            a record to add
      */
     public void addAnswerRR(ResourceRecord rr) {
         answerRRs.addElement(rr);
@@ -546,7 +587,9 @@
 
     /**
      * Adds a new question record to the message.
-     * @param rr a record to add
+     * 
+     * @param rr
+     *            a record to add
      */
     public void addAuthorityRR(ResourceRecord rr) {
         authorityRRs.addElement(rr);
@@ -561,7 +604,9 @@
 
     /**
      * Adds a new question record to the message.
-     * @param rr a record to add
+     * 
+     * @param rr
+     *            a record to add
      */
     public void addAdditionalRR(ResourceRecord rr) {
         additionalRRs.addElement(rr);

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderConstants.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderConstants.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderConstants.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderConstants.java Sat Jun 23 13:53:42 2007
@@ -27,9 +27,7 @@
 
 /**
  * Contains various constants that are used in the provider classes.
- * 
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
+ *
  * @see RFC 1035
  */
 public class ProviderConstants {

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderMgr.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderMgr.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderMgr.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/ProviderMgr.java Sat Jun 23 13:53:42 2007
@@ -26,41 +26,40 @@
 import java.util.StringTokenizer;
 
 import org.apache.harmony.jndi.internal.nls.Messages;
-//import java.util.logging.Logger;
 
 /**
  * Contains some useful routines that are used in other classes.
- *
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  */
 public class ProviderMgr {
 
     static final int LOG_NONE = 0;
+
     static final int LOG_ERROR = 1;
+
     static final int LOG_WARNING = 2;
+
     static final int LOG_DEBUG = 3;
 
     static final boolean CHECK_NAMES = false;
 
-    //static final Logger logger =
-    //        Logger.getLogger(ProviderConstants.LOGGER_NAME);
-
     /**
      * Parses the given domain name and converts it into
-     * <code>length label length label ... length label</code> sequence of bytes.
+     * <code>length label length label ... length label</code> sequence of
+     * bytes.
      * 
-     * @param name a domain name, a dot-separated list of labels
-     * @param buffer target buffer in which the result will be written
-     * @param startIdx the index to start at while writing to the buffer array
+     * @param name
+     *            a domain name, a dot-separated list of labels
+     * @param buffer
+     *            target buffer in which the result will be written
+     * @param startIdx
+     *            the index to start at while writing to the buffer array
      * @return updated index of the buffer array
      */
     public static int writeName(String name, byte[] buffer, int startIdx)
-            throws DomainProtocolException
-    {
-        StringTokenizer st; 
+            throws DomainProtocolException {
+        StringTokenizer st;
         int idx = startIdx;
-        
+
         if (name != null) {
             // initial check
             if (buffer == null) {
@@ -71,11 +70,11 @@
                 throw new ArrayIndexOutOfBoundsException();
             }
             // parsing the name
-            //if (CHECK_NAMES && !checkName(name)) {
-            //    throw new DomainProtocolException(
-            //           "The syntax of the domain name " +
-            //            name + " does not conform to RFC 1035");
-            //}
+            // if (CHECK_NAMES && !checkName(name)) {
+            // throw new DomainProtocolException(
+            // "The syntax of the domain name " +
+            // name + " does not conform to RFC 1035");
+            // }
             st = new StringTokenizer(name, "."); //$NON-NLS-1$
             while (st.hasMoreTokens()) {
                 String token = st.nextToken();
@@ -89,7 +88,8 @@
                 tokenBytesLen = tokenBytes.length;
                 if (tokenBytesLen > ProviderConstants.LABEL_MAX_CHARS) {
                     // jndi.64=The domain label is too long: {0}
-                    throw new DomainProtocolException(Messages.getString("jndi.64", token)); //$NON-NLS-1$
+                    throw new DomainProtocolException(Messages.getString(
+                            "jndi.64", token)); //$NON-NLS-1$
                 }
                 if (idx + tokenBytesLen + 1 > buffer.length) {
                     throw new ArrayIndexOutOfBoundsException();
@@ -100,8 +100,8 @@
                 }
                 if (idx - startIdx + 1 > ProviderConstants.NAME_MAX_CHARS) {
                     // jndi.5A=The domain name is more than {0} octets long: {1}
-                    throw new DomainProtocolException(
-                            Messages.getString("jndi.5A", ProviderConstants.NAME_MAX_CHARS, name)); //$NON-NLS-1$
+                    throw new DomainProtocolException(Messages.getString(
+                            "jndi.5A", ProviderConstants.NAME_MAX_CHARS, name)); //$NON-NLS-1$
                 }
             }
             // every domain name should end with an zero octet
@@ -113,15 +113,18 @@
     /**
      * Parses the domain name from the sequence of bytes.
      * 
-     * @param mesBytes byte representation of the message
-     * @param startIdx the position to start the parsing at
-     * @param result the string buffer to store parsed strings into
+     * @param mesBytes
+     *            byte representation of the message
+     * @param startIdx
+     *            the position to start the parsing at
+     * @param result
+     *            the string buffer to store parsed strings into
      * @return updated index of <code>mesBytes</code> array
-     * @throws DomainProtocolException if something went wrong
+     * @throws DomainProtocolException
+     *             if something went wrong
      */
     public static int parseName(byte[] mesBytes, int startIdx,
-            StringBuffer result) throws DomainProtocolException
-    {
+            StringBuffer result) throws DomainProtocolException {
         int idx = startIdx;
         boolean firstTime = true;
 
@@ -162,7 +165,7 @@
             }
             // append parsed label
             if (firstTime) {
-                firstTime = false;                
+                firstTime = false;
             } else {
                 result.append('.');
             }
@@ -171,13 +174,15 @@
         }
         return idx;
     }
-    
+
     /**
      * Compares two labels and returns the matching count (number of the
-     *  matching labels down from the root).
+     * matching labels down from the root).
      * 
-     * @param name1 first name
-     * @param name2 second name
+     * @param name1
+     *            first name
+     * @param name2
+     *            second name
      * @return number of equal labels from the root to leaves
      */
     public static int getMatchingCount(String name1, String name2) {
@@ -201,7 +206,9 @@
 
     /**
      * Returns the name of parent DNS zone for given zone.
-     * @param name the current DNS zone name
+     * 
+     * @param name
+     *            the current DNS zone name
      * @return the name of the parent
      */
     public static String getParentName(String name) {
@@ -214,7 +221,7 @@
             return "."; //$NON-NLS-1$
         }
         n = name.indexOf('.');
-        if (n != -1 && name.length() > n + 1)  {
+        if (n != -1 && name.length() > n + 1) {
             return name.substring(n + 1, name.length());
         }
         return "."; //$NON-NLS-1$
@@ -223,9 +230,12 @@
     /**
      * Writes a 16-bit integer value into the buffer, high byte first
      * 
-     * @param value the value to write, first 16 bits will be taken
-     * @param buffer the buffer to write into
-     * @param startIdx a starting index
+     * @param value
+     *            the value to write, first 16 bits will be taken
+     * @param buffer
+     *            the buffer to write into
+     * @param startIdx
+     *            a starting index
      * @return updated index
      */
     public static int write16Int(int value, byte[] buffer, int startIdx) {
@@ -236,13 +246,15 @@
         return idx;
     }
 
-
     /**
      * Writes a 32-bit integer value into the buffer, highest byte first
      * 
-     * @param value the value to write, first 32 bits will be taken 
-     * @param buffer the buffer to write into
-     * @param startIdx a starting index
+     * @param value
+     *            the value to write, first 32 bits will be taken
+     * @param buffer
+     *            the buffer to write into
+     * @param startIdx
+     *            a starting index
      * @return updated index
      */
     public static int write32Int(long value, byte[] buffer, int startIdx) {
@@ -253,13 +265,16 @@
         buffer[idx++] = (byte) ((value & 0xff00) >> 8);
         buffer[idx++] = (byte) (value & 0xff);
         return idx;
-    } 
+    }
 
     /**
-     * Parses 8 bit integer.
-     * Buffer index should be updated manually after call to this method.
-     * @param buffer sequence of bytes
-     * @param startIdx the index to start at
+     * Parses 8 bit integer. Buffer index should be updated manually after call
+     * to this method.
+     * 
+     * @param buffer
+     *            sequence of bytes
+     * @param startIdx
+     *            the index to start at
      * @return parsed integer value
      */
     public static int parse8Int(byte[] buffer, int idx) {
@@ -267,10 +282,13 @@
     }
 
     /**
-     * Parses 16 bit integer.
-     * Buffer index should be updated manually after call to this method.
-     * @param buffer sequence of bytes
-     * @param startIdx the index to start at
+     * Parses 16 bit integer. Buffer index should be updated manually after call
+     * to this method.
+     * 
+     * @param buffer
+     *            sequence of bytes
+     * @param startIdx
+     *            the index to start at
      * @return parsed integer value
      */
     public static int parse16Int(byte[] buffer, int idx) {
@@ -281,10 +299,13 @@
     }
 
     /**
-     * Parses 32 bit integer.
-     * Buffer index should be updated manually after call to this method.
-     * @param buffer sequence of bytes
-     * @param startIdx the index to start at
+     * Parses 32 bit integer. Buffer index should be updated manually after call
+     * to this method.
+     * 
+     * @param buffer
+     *            sequence of bytes
+     * @param startIdx
+     *            the index to start at
      * @return parsed integer value
      */
     public static long parse32Int(byte[] buffer, int idx) {
@@ -293,21 +314,26 @@
         long c = (((long) buffer[idx + 2]) & 0xff) << 8;
         long d = ((long) buffer[idx + 3]) & 0xff;
 
-        return (a | b | c | d); 
+        return (a | b | c | d);
     }
-   
+
     /**
      * Writes character string preceded with length octet.
-     * @param value string value to write
-     * @param buffer buffer to write to
-     * @param startIdx index in buffer to start from
+     * 
+     * @param value
+     *            string value to write
+     * @param buffer
+     *            buffer to write to
+     * @param startIdx
+     *            index in buffer to start from
      * @return updated index
-     * @throws NullPointerException if some argument is null
-     * @throws DomainProtocolException if string is too long
+     * @throws NullPointerException
+     *             if some argument is null
+     * @throws DomainProtocolException
+     *             if string is too long
      */
     public static int writeCharString(String value, byte[] buffer, int startIdx)
-            throws DomainProtocolException
-    {
+            throws DomainProtocolException {
         byte[] bytes;
         int idx = startIdx;
 
@@ -320,7 +346,7 @@
             throw new DomainProtocolException(Messages.getString("jndi.5F")); //$NON-NLS-1$
         }
         bytes = value.getBytes();
-        buffer[idx++] = (byte) bytes.length; 
+        buffer[idx++] = (byte) bytes.length;
         for (byte element : bytes) {
             buffer[idx++] = element;
         }
@@ -329,14 +355,17 @@
 
     /**
      * Parses the string of characters preceded with length octet.
-     * @param mesBytes message bytes
-     * @param startIdx the index to start parsing from
-     * @param result string buffer to write the result too 
+     * 
+     * @param mesBytes
+     *            message bytes
+     * @param startIdx
+     *            the index to start parsing from
+     * @param result
+     *            string buffer to write the result too
      * @return updated index
      */
     public static int parseCharString(byte[] mesBytes, int startIdx,
-            StringBuffer result)
-    {
+            StringBuffer result) {
         int len;
 
         if (mesBytes == null || result == null) {
@@ -347,29 +376,34 @@
         result.append(new String(mesBytes, startIdx + 1, len));
         return startIdx + 1 + len;
     }
-    
+
     /**
      * Sets or drops specific bit(s) of the given number.
      * 
-     * @param value target integer value 
-     * @param mask specifies bit(s) position(s)
-     * @param bit set if <code>true</code>, drop if <code>false</code>
+     * @param value
+     *            target integer value
+     * @param mask
+     *            specifies bit(s) position(s)
+     * @param bit
+     *            set if <code>true</code>, drop if <code>false</code>
      * @return updated <code>value</code>
      */
     public static int setBit(int value, int mask, boolean bit) {
         if (bit) {
-            value |= mask; 
+            value |= mask;
         } else {
             value &= ~mask;
         }
-        return value; 
+        return value;
     }
 
     /**
      * Checks if any of specified bits is set.
      * 
-     * @param value the number to look at
-     * @param mask a bit mask
+     * @param value
+     *            the number to look at
+     * @param mask
+     *            a bit mask
      * @return <code>true</code> of <code>false</code>
      */
     public static boolean checkBit(int value, int mask) {
@@ -384,13 +418,16 @@
      * <ol>
      * <li>Case insensitive</li>
      * <li>Appends "." to the end of the name if necessary before comparison</li>
-     * </ol>   
-     * @param name1 name1
-     * @param name2 name2
-     * @return <code>true</code> if names are equal; <code>false</code> otherwise
+     * </ol>
+     * 
+     * @param name1
+     *            name1
+     * @param name2
+     *            name2
+     * @return <code>true</code> if names are equal; <code>false</code>
+     *         otherwise
      */
-    public static boolean namesAreEqual(String name1, String name2)
-    {
+    public static boolean namesAreEqual(String name1, String name2) {
         if (!name1.endsWith(".")) { //$NON-NLS-1$
             name1 += "."; //$NON-NLS-1$
         }
@@ -401,37 +438,30 @@
     }
 
     /**
-     * Removes _Service._Proto fields from SRV-style qName if any. Adds
-     * final dot to the end of name
-     * @param name name to process
+     * Removes _Service._Proto fields from SRV-style qName if any. Adds final
+     * dot to the end of name
+     * 
+     * @param name
+     *            name to process
      * @return converted name
      */
-/*
-    public static String removeSRVExtra(String name) {
-        StringTokenizer st;
-        int k = 0;
-        StringBuffer res = new StringBuffer();
-        
-        if (name == null) {
-            return name;
-        }
-        st = new StringTokenizer(name, ".", false);
-        while (st.hasMoreTokens()) { 
-            String token = st.nextToken();
+    /*
+     * public static String removeSRVExtra(String name) { StringTokenizer st;
+     * int k = 0; StringBuffer res = new StringBuffer();
+     * 
+     * if (name == null) { return name; } st = new StringTokenizer(name, ".",
+     * false); while (st.hasMoreTokens()) { String token = st.nextToken();
+     * 
+     * if ((k != 0 && k != 1) || !token.startsWith("_")) { res.append(token); }
+     * k++; } return res.toString(); }
+     */
 
-            if ((k != 0 && k != 1) || !token.startsWith("_")) {
-                res.append(token);
-            }
-            k++;
-        }
-        return res.toString();
-    }
-*/  
-      
     /**
      * Converts all letters to lower case and adds "." to the end of zone name
      * if necessary.
-     * @param zone zone name
+     * 
+     * @param zone
+     *            zone name
      * @return expanded zone name
      */
     public static String normalizeName(String zone) {
@@ -441,15 +471,15 @@
         return zone.endsWith(".") ? zone.toLowerCase() : //$NON-NLS-1$
                 zone.toLowerCase() + "."; //$NON-NLS-1$
     }
-    
 
     /**
      * Creates the text representation of IPv4 address.
      * 
-     * @param ip the first four bytes should contain an IPv4 address
+     * @param ip
+     *            the first four bytes should contain an IPv4 address
      * @return string in <code>n.n.n.n</code> format
-     * @throws java.lang.IllegalArgumentException if given array has the length
-     *  less than four
+     * @throws java.lang.IllegalArgumentException
+     *             if given array has the length less than four
      */
     public static String getIpStr(byte[] ip) {
         StringBuffer sb = new StringBuffer();
@@ -470,17 +500,19 @@
     /**
      * Parses the text representation of IPv4 address.
      * 
-     * @param ipStr string in <code>n.n.n.n</code> format.
+     * @param ipStr
+     *            string in <code>n.n.n.n</code> format.
      * @return four bytes with parsed IP address
-     * @throws java.lang.NullPointerException if <code>ipStr</code> is null
-     * @throws java.lang.IllegalArgumentException if given string is not in
-     *  appropriate format
+     * @throws java.lang.NullPointerException
+     *             if <code>ipStr</code> is null
+     * @throws java.lang.IllegalArgumentException
+     *             if given string is not in appropriate format
      */
     public static byte[] parseIpStr(String ipStr) {
         StringTokenizer st;
         byte[] b = new byte[4];
         // jndi.62=Given string is not in appropriate format
-        final String errMsg1 = Messages.getString("jndi.62");  //$NON-NLS-1$
+        final String errMsg1 = Messages.getString("jndi.62"); //$NON-NLS-1$
 
         if (ipStr != null) {
             int k = 0;
@@ -508,7 +540,8 @@
     }
 
     /**
-     * @param str string name of the DNS record class
+     * @param str
+     *            string name of the DNS record class
      * @return integer number for the class; <code>-1</code> if not found
      */
     public static int getRecordClassNumber(String str) {
@@ -523,7 +556,8 @@
     }
 
     /**
-     * @param str string name of the DNS record type
+     * @param str
+     *            string name of the DNS record type
      * @return integer number for the type; <code>-1</code> if not found
      */
     public static int getRecordTypeNumber(String str) {

Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/QuestionRecord.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/QuestionRecord.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/QuestionRecord.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/QuestionRecord.java Sat Jun 23 13:53:42 2007
@@ -25,12 +25,9 @@
 
 import org.apache.harmony.jndi.internal.nls.Messages;
 
-
 /**
  * Represents domain protocol Question Record
  * 
- * @author Alexei Zakharov
- * @version $Revision: 1.1.2.4 $
  * @see RFC 1035
  */
 public class QuestionRecord {
@@ -43,39 +40,38 @@
 
     /** class of query */
     private int qClass;
-    
+
     /** Empty constructor */
-    public QuestionRecord() {}
+    public QuestionRecord() {
+    }
 
     /**
      * Constructs new question record with given parameters
      * 
-     * @param qName domain name
-     * @param qType question record type
-     * @param qClass question record class
-     */
-    public QuestionRecord(
-            String qName,
-            int qType,
-            int qClass)
-    {
+     * @param qName
+     *            domain name
+     * @param qType
+     *            question record type
+     * @param qClass
+     *            question record class
+     */
+    public QuestionRecord(String qName, int qType, int qClass) {
         this.qName = qName;
         this.qType = qType;
         this.qClass = qClass;
     }
 
-   
     /**
      * Creates a sequence of bytes that represents the current question record.
-     *  
-     * @param buffer the buffer in which the result byte sequence will be
-     *  written
-     * @param startIdx the index in the buffer to start at
+     * 
+     * @param buffer
+     *            the buffer in which the result byte sequence will be written
+     * @param startIdx
+     *            the index in the buffer to start at
      * @return updated index of the buffer array
      */
     public int writeBytes(byte[] buffer, int startIdx)
-        throws DomainProtocolException
-    {
+            throws DomainProtocolException {
         int idx = startIdx;
 
         // basic checkings
@@ -94,22 +90,25 @@
         idx = ProviderMgr.write16Int(qClass, buffer, idx);
         return idx;
     }
-    // getters and setters methods
 
+    // getters and setters methods
 
     /**
      * Parses given sequence of bytes and constructs a question record from it.
      * 
-     * @param mesBytes the byte array that should be parsed
-     * @param startIdx an index of <code>mesBytes</code> array to start the
-     *  parsing at
-     * @param resultQR an object the result of the operation will be stored into
+     * @param mesBytes
+     *            the byte array that should be parsed
+     * @param startIdx
+     *            an index of <code>mesBytes</code> array to start the parsing
+     *            at
+     * @param resultQR
+     *            an object the result of the operation will be stored into
      * @return updated index of <code>mesBytes</code> array
-     * @throws DomainProtocolException if something went wrong
+     * @throws DomainProtocolException
+     *             if something went wrong
      */
     public static int parseRecord(byte[] mesBytes, int startIdx,
-            QuestionRecord resultQR) throws DomainProtocolException
-    {
+            QuestionRecord resultQR) throws DomainProtocolException {
         int idx = startIdx;
         StringBuffer nameSB = new StringBuffer();
 
@@ -118,7 +117,7 @@
             throw new NullPointerException(Messages.getString("jndi.33")); //$NON-NLS-1$
         }
         // name
-        idx = ProviderMgr.parseName(mesBytes, idx , nameSB);
+        idx = ProviderMgr.parseName(mesBytes, idx, nameSB);
         resultQR.setQName(nameSB.toString());
         // QTYPE
         resultQR.setQType(ProviderMgr.parse16Int(mesBytes, idx));
@@ -128,7 +127,7 @@
         idx += 2;
         return idx;
     }
-   
+
     @Override
     public String toString() {
         StringBuffer sb = new StringBuffer();
@@ -158,34 +157,43 @@
     public int getQClass() {
         return qClass;
     }
+
     /**
-     * @param class1 The qClass to set.
+     * @param class1
+     *            The qClass to set.
      */
     public void setQClass(int class1) {
         qClass = class1;
     }
+
     /**
      * @return Returns the qName.
      */
     public String getQName() {
         return qName;
     }
+
     /**
-     * @param name The qName to set.
+     * @param name
+     *            The qName to set.
      */
     public void setQName(String name) {
         qName = name;
     }
+
     /**
      * @return Returns the qType.
      */
     public int getQType() {
         return qType;
     }
+
     /**
-     * @param type The qType to set.
+     * @param type
+     *            The qType to set.
      */
     public void setQType(int type) {
         qType = type;
     }
+
 }