-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LANG-1720: Fix Javadoc description of exceptions thrown for existing classes #1160
Changes from all commits
6000ae1
b175059
9a04fff
939b946
798c080
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -538,6 +538,7 @@ public String replace(final char[] source) { | |
* @param offset the start offset within the array, must be valid | ||
* @param length the length within the array to be processed, must be valid | ||
* @return the result of the replace operation | ||
* @throws StringIndexOutOfBoundsException if {@code offset < 0 || offset + length >= source.length} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why String instead of array here? If this is the behavior it might be a bug. Change the doc to just IndexOutOfBoundsException for now in case we need to fix this. |
||
*/ | ||
public String replace(final char[] source, final int offset, final int length) { | ||
if (source == null) { | ||
|
@@ -577,6 +578,7 @@ public String replace(final CharSequence source) { | |
* @param offset the start offset within the array, must be valid | ||
* @param length the length within the array to be processed, must be valid | ||
* @return the result of the replace operation | ||
* @throws StringIndexOutOfBoundsException if {@code offset < 0 || offset + length >= source.length} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should maybe be IndexOutOfBoundsException |
||
* @since 3.2 | ||
*/ | ||
public String replace(final CharSequence source, final int offset, final int length) { | ||
|
@@ -675,6 +677,7 @@ public String replace(final String source) { | |
* @param offset the start offset within the array, must be valid | ||
* @param length the length within the array to be processed, must be valid | ||
* @return the result of the replace operation | ||
* @throws StringIndexOutOfBoundsException if {@code offset < 0 || offset + length >= source.length} | ||
*/ | ||
public String replace(final String source, final int offset, final int length) { | ||
if (source == null) { | ||
|
@@ -717,6 +720,7 @@ public String replace(final StringBuffer source) { | |
* @param offset the start offset within the array, must be valid | ||
* @param length the length within the array to be processed, must be valid | ||
* @return the result of the replace operation | ||
* @throws StringIndexOutOfBoundsException if {@code offset < 0 || offset + length >= source.length} | ||
*/ | ||
public String replace(final StringBuffer source, final int offset, final int length) { | ||
if (source == null) { | ||
|
@@ -753,6 +757,7 @@ public boolean replaceIn(final StrBuilder source) { | |
* @param offset the start offset within the array, must be valid | ||
* @param length the length within the builder to be processed, must be valid | ||
* @return true if altered | ||
* @throws StringIndexOutOfBoundsException if {@code offset < 0 || offset + length >= source.length} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does strike me as possible that some of these exceptions shouldn't be thrown at all. If offset or length are out of bounds, maybe nothing is replaced. |
||
*/ | ||
public boolean replaceIn(final StrBuilder source, final int offset, final int length) { | ||
if (source == null) { | ||
|
@@ -789,6 +794,7 @@ public boolean replaceIn(final StringBuffer source) { | |
* @param offset the start offset within the array, must be valid | ||
* @param length the length within the buffer to be processed, must be valid | ||
* @return true if altered | ||
* @throws StringIndexOutOfBoundsException if {@code offset < 0 || offset + length >= source.length} | ||
*/ | ||
public boolean replaceIn(final StringBuffer source, final int offset, final int length) { | ||
if (source == null) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not api doc. It's a new exception, and I'm not sure it's correct.