Skip to content

Commit 8b572c6

Browse files
author
rdasgupt
committed
Fix critical issue introduced by PR #745
Signed-off-by: rdasgupt <ranjan.dasgupta@us.ibm.com>
1 parent 4c1a70c commit 8b572c6

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/MqttDataTypesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void testICanEatGlass() throws IOException, MqttException {
127127
try {
128128
decodedFileName = java.net.URLDecoder.decode( encodedFileName, StandardCharsets.UTF_8.name() );
129129
}
130-
catch ( UnsupportedEncodingException e ) {
130+
catch ( Exception e ) {
131131
// can't decode the URL, passing on the encoded name hoping that it
132132
// actually contains something that exists in the filesystem with
133133
// that name.

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/properties/TestProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public static String getClientKeyStore() {
338338
try {
339339
return java.net.URLDecoder.decode( encodedPath, StandardCharsets.UTF_8.name());
340340
}
341-
catch (UnsupportedEncodingException e ) {
341+
catch (Exception e ) {
342342
// likely the property value is malformed. Return it as is, hoping that
343343
// the requester knows what to make of it.
344344
return encodedPath;

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/security/SSLSocketFactoryFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,8 @@ public String getTrustStore(String configID) {
10121012
String decodedPath = java.net.URLDecoder.decode( encodedPath, StandardCharsets.UTF_8.name());
10131013
return decodedPath;
10141014
}
1015-
catch( UnsupportedEncodingException e ) {
1015+
catch( Exception e ) {
1016+
// To maintain backword compatibility, return encodedPath for any exception
10161017
return encodedPath;
10171018
}
10181019
}

0 commit comments

Comments
 (0)