Skip to content

Commit f98972a

Browse files
author
Steve Powell
committed
Eliminate a few unnecessary UnsupportedEncodingException references.
1 parent d523b0a commit f98972a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private String uriDecode(String s) {
256256
// form encoding. So protect plus signs.
257257
return URLDecoder.decode(s.replace("+", "%2B"), "US-ASCII");
258258
}
259-
catch (java.io.UnsupportedEncodingException e) {
259+
catch (IOException e) {
260260
throw new RuntimeException(e);
261261
}
262262
}

src/com/rabbitmq/client/StringRpcServer.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package com.rabbitmq.client;
1919

2020
import java.io.IOException;
21-
import java.io.UnsupportedEncodingException;
2221

2322
/**
2423
* Subclass of RpcServer which accepts UTF-8 string requests.
@@ -42,13 +41,13 @@ public byte[] handleCall(byte[] requestBody, AMQP.BasicProperties replyPropertie
4241
String request;
4342
try {
4443
request = new String(requestBody, STRING_ENCODING);
45-
} catch (UnsupportedEncodingException uee) {
44+
} catch (IOException _) {
4645
request = new String(requestBody);
4746
}
4847
String reply = handleStringCall(request, replyProperties);
4948
try {
5049
return reply.getBytes(STRING_ENCODING);
51-
} catch (UnsupportedEncodingException uee) {
50+
} catch (IOException _) {
5251
return reply.getBytes();
5352
}
5453
}
@@ -71,14 +70,14 @@ public String handleStringCall(String request)
7170

7271
/**
7372
* Overridden to do UTF-8 processing, and delegate to
74-
* handleStringCast. If UTF-8 is not understood by this JVM, falls
75-
* back to the platform default.
73+
* handleStringCast. If requestBody cannot be interpreted as UTF-8
74+
* tries the platform default.
7675
*/
7776
public void handleCast(byte[] requestBody)
7877
{
7978
try {
8079
handleStringCast(new String(requestBody, STRING_ENCODING));
81-
} catch (UnsupportedEncodingException uee) {
80+
} catch (IOException _) {
8281
handleStringCast(new String(requestBody));
8382
}
8483
}

0 commit comments

Comments
 (0)