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/plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r10179 r10212  
    1515import java.io.File;
    1616import java.io.FilenameFilter;
     17import java.io.IOException;
    1718import java.net.URL;
    1819import java.net.URLClassLoader;
     
    723724                        + "Delete from preferences?</html>", plugin.name, plugin.className);
    724725            }
    725         }  catch (Exception e) {
     726        }  catch (RuntimeException e) {
    726727            pluginLoadingExceptions.put(plugin.name, e);
    727728            Main.error(e);
     
    11931194                // Check the plugin is a valid and accessible JAR file before installing it (fix #7754)
    11941195                new JarFile(updatedPlugin).close();
    1195             } catch (Exception e) {
     1196            } catch (IOException e) {
    11961197                if (dowarn) {
    11971198                    Main.warn(tr("Failed to install plugin ''{0}'' from temporary download file ''{1}''. {2}",
     
    12211222            try {
    12221223                new JarFile(jar).close();
    1223             } catch (Exception e) {
     1224            } catch (IOException e) {
    12241225                Main.warn(e);
    12251226                return false;
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r9983 r10212  
    273273                        }
    274274                    }
    275                 } catch (Exception e) {
     275                } catch (NumberFormatException e) {
    276276                    Main.error(e);
    277277                }
  • trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java

    r10055 r10212  
    22package org.openstreetmap.josm.plugins;
    33
     4import java.lang.reflect.InvocationTargetException;
    45import java.util.List;
    56
     
    4546        } catch (NoSuchMethodException e) {
    4647            Main.debug("Plugin "+plugin+" does not define mapFrameInitialized");
    47         } catch (Exception e) {
     48        } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
    4849            handlePluginException(e);
    4950        }
     
    5758            Main.debug("Plugin "+plugin+" does not define getPreferenceSetting");
    5859            return null;
    59         } catch (Exception e) {
     60        } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
    6061            handlePluginException(e);
    6162        }
     
    6970        } catch (NoSuchMethodException e) {
    7071            Main.debug("Plugin "+plugin+" does not define addDownloadSelection");
    71         } catch (Exception e) {
     72        } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
    7273            handlePluginException(e);
    7374        }
Note: See TracChangeset for help on using the changeset viewer.