Simplify catch clauses
Change-Id: Ib49ac1d8f7e42323d72a99d1c807f610f48b71ee
Showing
1 changed file
with
4 additions
and
16 deletions
| ... | @@ -82,10 +82,7 @@ class LinkProviderServiceClientProxy | ... | @@ -82,10 +82,7 @@ class LinkProviderServiceClientProxy |
| 82 | log.error("linkDetected({}) failed", linkDescription, e); | 82 | log.error("linkDetected({}) failed", linkDescription, e); |
| 83 | invalidate(); | 83 | invalidate(); |
| 84 | Thread.currentThread().interrupt(); | 84 | Thread.currentThread().interrupt(); |
| 85 | - } catch (ExecutionException e) { | 85 | + } catch (ExecutionException | TimeoutException e) { |
| 86 | - log.error("linkDetected({}) failed", linkDescription, e); | ||
| 87 | - invalidate(); | ||
| 88 | - } catch (TimeoutException e) { | ||
| 89 | log.error("linkDetected({}) failed", linkDescription, e); | 86 | log.error("linkDetected({}) failed", linkDescription, e); |
| 90 | invalidate(); | 87 | invalidate(); |
| 91 | } | 88 | } |
| ... | @@ -105,10 +102,7 @@ class LinkProviderServiceClientProxy | ... | @@ -105,10 +102,7 @@ class LinkProviderServiceClientProxy |
| 105 | log.error("linkVanished({}) failed", linkDescription, e); | 102 | log.error("linkVanished({}) failed", linkDescription, e); |
| 106 | invalidate(); | 103 | invalidate(); |
| 107 | Thread.currentThread().interrupt(); | 104 | Thread.currentThread().interrupt(); |
| 108 | - } catch (ExecutionException e) { | 105 | + } catch (ExecutionException | TimeoutException e) { |
| 109 | - log.error("linkVanished({}) failed", linkDescription, e); | ||
| 110 | - invalidate(); | ||
| 111 | - } catch (TimeoutException e) { | ||
| 112 | log.error("linkVanished({}) failed", linkDescription, e); | 106 | log.error("linkVanished({}) failed", linkDescription, e); |
| 113 | invalidate(); | 107 | invalidate(); |
| 114 | } | 108 | } |
| ... | @@ -128,10 +122,7 @@ class LinkProviderServiceClientProxy | ... | @@ -128,10 +122,7 @@ class LinkProviderServiceClientProxy |
| 128 | log.error("linksVanished({}) failed", connectPoint, e); | 122 | log.error("linksVanished({}) failed", connectPoint, e); |
| 129 | invalidate(); | 123 | invalidate(); |
| 130 | Thread.currentThread().interrupt(); | 124 | Thread.currentThread().interrupt(); |
| 131 | - } catch (ExecutionException e) { | 125 | + } catch (ExecutionException | TimeoutException e) { |
| 132 | - log.error("linksVanished({}) failed", connectPoint, e); | ||
| 133 | - invalidate(); | ||
| 134 | - } catch (TimeoutException e) { | ||
| 135 | log.error("linksVanished({}) failed", connectPoint, e); | 126 | log.error("linksVanished({}) failed", connectPoint, e); |
| 136 | invalidate(); | 127 | invalidate(); |
| 137 | } | 128 | } |
| ... | @@ -151,10 +142,7 @@ class LinkProviderServiceClientProxy | ... | @@ -151,10 +142,7 @@ class LinkProviderServiceClientProxy |
| 151 | log.error("linksVanished({}) failed", deviceId, e); | 142 | log.error("linksVanished({}) failed", deviceId, e); |
| 152 | invalidate(); | 143 | invalidate(); |
| 153 | Thread.currentThread().interrupt(); | 144 | Thread.currentThread().interrupt(); |
| 154 | - } catch (ExecutionException e) { | 145 | + } catch (ExecutionException | TimeoutException e) { |
| 155 | - log.error("linksVanished({}) failed", deviceId, e); | ||
| 156 | - invalidate(); | ||
| 157 | - } catch (TimeoutException e) { | ||
| 158 | log.error("linksVanished({}) failed", deviceId, e); | 146 | log.error("linksVanished({}) failed", deviceId, e); |
| 159 | invalidate(); | 147 | invalidate(); |
| 160 | } | 148 | } | ... | ... |
-
Please register or login to post a comment