From 3022e3d8354945ace28cad7b6839f646fa24abb1 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 30 Mar 2019 17:31:56 +0100 Subject: [PATCH] Mark ignored Exceptions as such --- .../BluetoothBackend/BluetoothLink.java | 2 +- .../Backends/LanBackend/LanLink.java | 6 +++--- src/org/kde/kdeconnect/NetworkPacket.java | 20 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java b/src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java index 815b337a..4a857130 100644 --- a/src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java +++ b/src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java @@ -144,7 +144,7 @@ public class BluetoothLink extends BaseLink { continueAccepting = false; try { socket.close(); - } catch (IOException e) { + } catch (IOException ignored) { } linkProvider.disconnectedLink(this, getDeviceId(), socket); } diff --git a/src/org/kde/kdeconnect/Backends/LanBackend/LanLink.java b/src/org/kde/kdeconnect/Backends/LanBackend/LanLink.java index edae946a..3b0dc707 100644 --- a/src/org/kde/kdeconnect/Backends/LanBackend/LanLink.java +++ b/src/org/kde/kdeconnect/Backends/LanBackend/LanLink.java @@ -216,10 +216,10 @@ public class LanLink extends BaseLink { outputStream.flush(); Log.i("KDE/LanLink", "Finished sending payload ("+progress+" bytes written)"); } finally { - try { server.close(); } catch (Exception e) { } - try { payloadSocket.close(); } catch (Exception e) { } + try { server.close(); } catch (Exception ignored) { } + try { payloadSocket.close(); } catch (Exception ignored) { } np.getPayload().close(); - try { outputStream.close(); } catch (Exception e) { } + try { outputStream.close(); } catch (Exception ignored) { } } } diff --git a/src/org/kde/kdeconnect/NetworkPacket.java b/src/org/kde/kdeconnect/NetworkPacket.java index 7cbfa0c3..369e2a47 100644 --- a/src/org/kde/kdeconnect/NetworkPacket.java +++ b/src/org/kde/kdeconnect/NetworkPacket.java @@ -91,7 +91,7 @@ public class NetworkPacket { if (value == null) return; try { mBody.put(key, value); - } catch (Exception e) { + } catch (Exception ignored) { } } @@ -114,7 +114,7 @@ public class NetworkPacket { public void set(String key, int value) { try { mBody.put(key, value); - } catch (Exception e) { + } catch (Exception ignored) { } } @@ -129,7 +129,7 @@ public class NetworkPacket { public void set(String key, boolean value) { try { mBody.put(key, value); - } catch (Exception e) { + } catch (Exception ignored) { } } @@ -144,7 +144,7 @@ public class NetworkPacket { public void set(String key, double value) { try { mBody.put(key, value); - } catch (Exception e) { + } catch (Exception ignored) { } } @@ -155,7 +155,7 @@ public class NetworkPacket { public void set(String key, JSONArray value) { try { mBody.put(key, value); - } catch (Exception e) { + } catch (Exception ignored) { } } @@ -166,7 +166,7 @@ public class NetworkPacket { public void set(String key, JSONObject value) { try { mBody.put(key, value); - } catch (JSONException e) { + } catch (JSONException ignored) { } } @@ -179,7 +179,7 @@ public class NetworkPacket { try { String str = jsonArray.getString(i); list.add(str); - } catch (Exception e) { + } catch (Exception ignored) { } } return list; @@ -197,7 +197,7 @@ public class NetworkPacket { jsonArray.put(str); } mBody.put(key, jsonArray); - } catch (Exception e) { + } catch (Exception ignored) { } } @@ -210,7 +210,7 @@ public class NetworkPacket { try { String str = jsonArray.getString(i); list.add(str); - } catch (Exception e) { + } catch (Exception ignored) { } } return list; @@ -228,7 +228,7 @@ public class NetworkPacket { jsonArray.put(str); } mBody.put(key, jsonArray); - } catch (Exception e) { + } catch (Exception ignored) { } }