You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by st...@apache.org on 2002/10/01 22:00:44 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder EqualsBuilder.java
stevencaswell 2002/10/01 13:00:43
Modified: lang/src/java/org/apache/commons/lang/builder
EqualsBuilder.java
Log:
javadoc corrections:
- corrected name of append method in code example
- changed <code> tag to <pre> tag around code examples for better formatting
- corrected reflection method name in explanation text
Revision Changes Path
1.4 +9 -9 jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java
Index: EqualsBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EqualsBuilder.java 22 Sep 2002 09:18:32 -0000 1.3
+++ EqualsBuilder.java 1 Oct 2002 20:00:43 -0000 1.4
@@ -72,33 +72,33 @@
* code must be used in the equals method, and vice versa.
* <p>
* Typical use for the code is as follows:
- * <code>
+ * <pre>
* public boolean equals(Object o) {
* if (!o instanceof MyClass) {
* return false;
* }
* MyClass rhs = (MyClass) o;
* return new EqualsBuilder()
- * .test(field1, rhs.field1)
- * .test(field2, rhs.field2)
- * .test(field3, rhs.field3)
+ * .append(field1, rhs.field1)
+ * .append(field2, rhs.field2)
+ * .append(field3, rhs.field3)
* .isEquals();
* }
- * </code>
+ * </pre>
* <p>
* Alternatively, there is a method that uses reflection to determine
* the fields to test. Because these fields are usually private, the method,
- * <code>reflectionTest</code>, uses <code>Field.setAccessible</code> to change
+ * <code>reflectionEquals</code>, uses <code>Field.setAccessible</code> to change
* the visibility of the fields. This will fail under a security manager,
* unless the appropriate permissions are set. It is also slower than testing
* explicitly.
* <p>
* A typical invocation for this method would look like:
- * <code>
+ * <pre>
* public boolean equals(Object o) {
* return EqualsBuilder.reflectionEquals(this, obj);
* }
- * </code>
+ * </pre>
*
* @author <a href="mailto:steve.downey@netfolio.com">Steve Downey</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder EqualsBuilder.java
Posted by Daniel Rall <dl...@finemaltcoding.com>.
I like to use the following for formatting code examples in
JavaDoc/HTML:
<blockquote><code><pre>
...
</pre></code></blockquote>
stevencaswell@apache.org writes:
> stevencaswell 2002/10/01 13:00:43
>
> Modified: lang/src/java/org/apache/commons/lang/builder
> EqualsBuilder.java
> Log:
> javadoc corrections:
> - corrected name of append method in code example
> - changed <code> tag to <pre> tag around code examples for better formatting
> - corrected reflection method name in explanation text
>
> Revision Changes Path
> 1.4 +9 -9 jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java
>
> Index: EqualsBuilder.java
> ===================================================================
> RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- EqualsBuilder.java 22 Sep 2002 09:18:32 -0000 1.3
> +++ EqualsBuilder.java 1 Oct 2002 20:00:43 -0000 1.4
> @@ -72,33 +72,33 @@
> * code must be used in the equals method, and vice versa.
> * <p>
> * Typical use for the code is as follows:
> - * <code>
> + * <pre>
> * public boolean equals(Object o) {
> * if (!o instanceof MyClass) {
> * return false;
> * }
> * MyClass rhs = (MyClass) o;
> * return new EqualsBuilder()
> - * .test(field1, rhs.field1)
> - * .test(field2, rhs.field2)
> - * .test(field3, rhs.field3)
> + * .append(field1, rhs.field1)
> + * .append(field2, rhs.field2)
> + * .append(field3, rhs.field3)
> * .isEquals();
> * }
> - * </code>
> + * </pre>
> * <p>
> * Alternatively, there is a method that uses reflection to determine
> * the fields to test. Because these fields are usually private, the method,
> - * <code>reflectionTest</code>, uses <code>Field.setAccessible</code> to change
> + * <code>reflectionEquals</code>, uses <code>Field.setAccessible</code> to change
> * the visibility of the fields. This will fail under a security manager,
> * unless the appropriate permissions are set. It is also slower than testing
> * explicitly.
> * <p>
> * A typical invocation for this method would look like:
> - * <code>
> + * <pre>
> * public boolean equals(Object o) {
> * return EqualsBuilder.reflectionEquals(this, obj);
> * }
> - * </code>
> + * </pre>
> *
> * @author <a href="mailto:steve.downey@netfolio.com">Steve Downey</a>
> * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
Daniel Rall <dl...@finemaltcoding.com>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>