Ignore:
Timestamp:
2016-05-15T00:51:10+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S2221 - "Exception" should not be caught when not required by called methods

Location:
trunk/src/org/openstreetmap/josm/io/remotecontrol
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java

    r9078 r10212  
    3636            instance4 = new RemoteControlHttpServer(port, false);
    3737            instance4.start();
    38         } catch (Exception ex) {
     38        } catch (IOException ex) {
    3939            Main.warn(marktr("Cannot start IPv4 remotecontrol server on port {0}: {1}"),
    4040                    Integer.toString(port), ex.getLocalizedMessage());
     
    4343            instance6 = new RemoteControlHttpServer(port, true);
    4444            instance6.start();
    45         } catch (Exception ex) {
     45        } catch (IOException ex) {
    4646            /* only show error when we also have no IPv4 */
    4747            if (instance4 == null) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r10060 r10212  
    333333                instance4 = new RemoteControlHttpsServer(port, false);
    334334                instance4.start();
    335             } catch (Exception ex) {
     335            } catch (IOException | GeneralSecurityException ex) {
    336336                Main.warn(marktr("Cannot start IPv4 remotecontrol https server on port {0}: {1}"),
    337337                        Integer.toString(port), ex.getLocalizedMessage());
     
    340340                instance6 = new RemoteControlHttpsServer(port, true);
    341341                instance6.start();
    342             } catch (Exception ex) {
     342            } catch (IOException | GeneralSecurityException ex) {
    343343                /* only show error when we also have no IPv4 */
    344344                if (instance4 == null) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r9732 r10212  
    4747                }
    4848            }
    49         } catch (Exception ex) {
     49        } catch (RuntimeException ex) {
    5050            Main.warn("RemoteControl: Error parsing import remote control request:");
    5151            Main.error(ex);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r10131 r10212  
    145145                }
    146146            }
    147         } catch (Exception ex) {
     147        } catch (RuntimeException ex) {
    148148            Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:");
    149149            Main.error(ex);
Note: See TracChangeset for help on using the changeset viewer.