michael-o commented on code in PR #370:
URL:
https://github.com/apache/httpcomponents-client/pull/370#discussion_r880387556
##########
httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/HttpRFC7578Multipart.java:
##########
@@ -129,7 +128,7 @@ public byte[] encode(final byte[] bytes) {
return buffer.toByteArray();
}
- public byte[] decode(final byte[] bytes) throws DecoderException {
+ public byte[] decode(final byte[] bytes) throws
IllegalArgumentException {
Review Comment:
This goes into Javadoc, not signature. It is a runtime exception
##########
httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/HttpRFC7578Multipart.java:
##########
@@ -138,7 +137,7 @@ public byte[] decode(final byte[] bytes) throws
DecoderException {
final int b = bytes[i];
if (b == ESCAPE_CHAR) {
if (i >= bytes.length - 2) {
- throw new DecoderException("Invalid URL encoding: too
short");
+ throw new IllegalArgumentException("Invalid URL
encoding: too short");
Review Comment:
What? URL encoding? This must be a typo, no?
##########
httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/HttpRFC7578Multipart.java:
##########
@@ -163,13 +162,13 @@ public byte[] decode(final byte[] bytes) throws
DecoderException {
* The byte to be converted.
* @return The numeric value represented by the character in radix 16.
*
- * @throws DecoderException
+ * @throws IllegalArgumentException
* Thrown when the byte is not valid per {@link
Character#digit(char,int)}
*/
- static int digit16(final byte b) throws DecoderException {
+ static int digit16(final byte b) throws IllegalArgumentException {
final int i = Character.digit((char) b, RADIX);
if (i == -1) {
- throw new DecoderException("Invalid URL encoding: not a valid
digit (radix " + RADIX + "): " + b);
+ throw new IllegalArgumentException("Invalid URL encoding: not a
valid digit (radix " + RADIX + "): " + b);
Review Comment:
same here
##########
httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/HttpRFC7578Multipart.java:
##########
@@ -163,13 +162,13 @@ public byte[] decode(final byte[] bytes) throws
DecoderException {
* The byte to be converted.
* @return The numeric value represented by the character in radix 16.
*
- * @throws DecoderException
+ * @throws IllegalArgumentException
* Thrown when the byte is not valid per {@link
Character#digit(char,int)}
*/
- static int digit16(final byte b) throws DecoderException {
+ static int digit16(final byte b) throws IllegalArgumentException {
Review Comment:
same here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]