1818package com .rabbitmq .client ;
1919
2020import 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