DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16076>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16076

Example in Javadoc for ToStringBuilder wrong for append.

           Summary: Example in Javadoc for ToStringBuilder wrong for append.
           Product: Commons
           Version: 1.0.1 Final
          Platform: Other
               URL: http://jakarta.apache.org/commons/lang/api/index.html
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The following is directly from the Javadoc page. Please see inline notes.

*** Begin Quote ***
To use this class write code as follows: 

 public class Person {
   String name;
   int age;
   boolean isSmoker;
 
   ...
 
   public String toString() {
     return new ToStringBuilder(this).
       append(name, "name").     //!! should be - append("name", name).
       append(age, "age").       //!! should be - append("age", age).
       append(smoker, "smoker"). //!! should be - append("smoker", smoker).
       toString();
   }
 }
*** End Quote ***

In short, the order of arguments to the append method in the example have been 
reversed.

Thank you.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to