From b9b6b027db0cbfbe3973fa74af3aebec4647cfd9 Mon Sep 17 00:00:00 2001 From: Niall Pemberton Date: Mon, 10 Jul 2006 11:23:57 +0000 Subject: [PATCH] Fix for LANG-272 - Minor JavaDoc changes to clean up checkstyle issues git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@420491 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang/StringEscapeUtils.java | 2 -- .../org/apache/commons/lang/enum/Enum.java | 6 ++++ .../org/apache/commons/lang/enums/Enum.java | 6 ++++ .../apache/commons/lang/text/StrBuilder.java | 32 +++++++++++-------- .../commons/lang/text/VariableFormatter.java | 11 +++++++ .../lang/time/DurationFormatUtils.java | 2 ++ 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/java/org/apache/commons/lang/StringEscapeUtils.java b/src/java/org/apache/commons/lang/StringEscapeUtils.java index 8e43499a4..845e8cddd 100644 --- a/src/java/org/apache/commons/lang/StringEscapeUtils.java +++ b/src/java/org/apache/commons/lang/StringEscapeUtils.java @@ -571,7 +571,6 @@ public static void unescapeHtml(Writer writer, String string) throws IOException * * @param writer the writer receiving the unescaped string, not null * @param str the String to escape, may be null - * @return a new escaped String, null if null string input * @throws IllegalArgumentException if the writer is null * @throws IOException if there is a problem writing * @see #unescapeXml(java.lang.String) @@ -624,7 +623,6 @@ public static String escapeXml(String str) { * * @param writer the writer receiving the unescaped string, not null * @param str the String to unescape, may be null - * @return a new unescaped String, null if null string input * @throws IllegalArgumentException if the writer is null * @throws IOException if there is a problem writing * @see #escapeXml(String) diff --git a/src/java/org/apache/commons/lang/enum/Enum.java b/src/java/org/apache/commons/lang/enum/Enum.java index 907f69b37..3facbade9 100644 --- a/src/java/org/apache/commons/lang/enum/Enum.java +++ b/src/java/org/apache/commons/lang/enum/Enum.java @@ -587,6 +587,12 @@ public int compareTo(Object other) { return iName.compareTo(((Enum) other).iName); } + /** + *

Use reflection to return an objects class name.

+ * + * @param other The object to determine the class name for + * @return The class name + */ private String getNameInOtherClassLoader(Object other) { try { Method mth = other.getClass().getMethod("getName", null); diff --git a/src/java/org/apache/commons/lang/enums/Enum.java b/src/java/org/apache/commons/lang/enums/Enum.java index 9b2d4fe34..6d7840111 100644 --- a/src/java/org/apache/commons/lang/enums/Enum.java +++ b/src/java/org/apache/commons/lang/enums/Enum.java @@ -584,6 +584,12 @@ public int compareTo(Object other) { return iName.compareTo(((Enum) other).iName); } + /** + *

Use reflection to return an objects class name.

+ * + * @param other The object to determine the class name for + * @return The class name + */ private String getNameInOtherClassLoader(Object other) { try { Method mth = other.getClass().getMethod("getName", null); diff --git a/src/java/org/apache/commons/lang/text/StrBuilder.java b/src/java/org/apache/commons/lang/text/StrBuilder.java index 7c3eb2250..5002b0663 100644 --- a/src/java/org/apache/commons/lang/text/StrBuilder.java +++ b/src/java/org/apache/commons/lang/text/StrBuilder.java @@ -2187,16 +2187,17 @@ class StrBuilderReader extends Reader { /** The last mark position. */ private int mark; + /** {@inheritDoc} */ StrBuilderReader() { super(); } - /** @inheritdoc */ + /** {@inheritDoc} */ public void close() { // do nothing } - /** @inheritdoc */ + /** {@inheritDoc} */ public int read() { if (ready() == false) { return -1; @@ -2204,7 +2205,7 @@ public int read() { return charAt(pos++); } - /** @inheritdoc */ + /** {@inheritDoc} */ public int read(char b[], int off, int len) { if (off < 0 || len < 0 || off > b.length || (off + len) > b.length || (off + len) < 0) { @@ -2224,6 +2225,7 @@ public int read(char b[], int off, int len) { return len; } + /** {@inheritDoc} */ public long skip(long n) { if (pos + n > size()) { n = size() - pos; @@ -2235,22 +2237,22 @@ public long skip(long n) { return n; } - /** @inheritdoc */ + /** {@inheritDoc} */ public boolean ready() { return pos < size(); } - /** @inheritdoc */ + /** {@inheritDoc} */ public boolean markSupported() { return true; } - /** @inheritdoc */ + /** {@inheritDoc} */ public void mark(int readAheadLimit) { mark = pos; } - /** @inheritdoc */ + /** {@inheritDoc} */ public void reset() { pos = mark; } @@ -2261,41 +2263,43 @@ public void reset() { * Inner class to allow StrBuilder to operate as a writer. */ class StrBuilderWriter extends Writer { + + /** {@inheritDoc} */ StrBuilderWriter() { super(); } - /** @inheritdoc */ + /** {@inheritDoc} */ public void close() { // do nothing } - /** @inheritdoc */ + /** {@inheritDoc} */ public void flush() { // do nothing } - /** @inheritdoc */ + /** {@inheritDoc} */ public void write(int c) { StrBuilder.this.append((char) c); } - /** @inheritdoc */ + /** {@inheritDoc} */ public void write(char[] cbuf) { StrBuilder.this.append(cbuf); } - /** @inheritdoc */ + /** {@inheritDoc} */ public void write(char[] cbuf, int off, int len) { StrBuilder.this.append(cbuf, off, len); } - /** @inheritdoc */ + /** {@inheritDoc} */ public void write(String str) { StrBuilder.this.append(str); } - /** @inheritdoc */ + /** {@inheritDoc} */ public void write(String str, int off, int len) { StrBuilder.this.append(str, off, len); } diff --git a/src/java/org/apache/commons/lang/text/VariableFormatter.java b/src/java/org/apache/commons/lang/text/VariableFormatter.java index 068d5ef88..cb9da27b9 100644 --- a/src/java/org/apache/commons/lang/text/VariableFormatter.java +++ b/src/java/org/apache/commons/lang/text/VariableFormatter.java @@ -205,6 +205,17 @@ protected static FieldPosition newTextToken(int aStartIndex, int aLength) { return newToken(VariableParser.TEXT_TOKEN, aStartIndex, aLength); } + /** + * Creates a new token of the specified type. + * + * @param type + * The token type + * @param beginIndex + * The token starting index + * @param length + * The token length + * @return a new token + */ private static FieldPosition newToken(int type, int beginIndex, int length) { FieldPosition fp = new FieldPosition(type); fp.setBeginIndex(beginIndex); diff --git a/src/java/org/apache/commons/lang/time/DurationFormatUtils.java b/src/java/org/apache/commons/lang/time/DurationFormatUtils.java index 05fb460c1..3c3f3ddbf 100644 --- a/src/java/org/apache/commons/lang/time/DurationFormatUtils.java +++ b/src/java/org/apache/commons/lang/time/DurationFormatUtils.java @@ -622,6 +622,8 @@ public boolean equals(Object obj2) { * Returns a hashcode for the token equal to the * hashcode for the token's value. Thus 'TT' and 'TTTT' * will have the same hashcode. + * + * @return The hashcode for the token */ public int hashCode() { return this.value.hashCode();