forked from I2P_Developers/i2p.i2p
lint: don't catch Exception, catch RuntimeException or checked exception.
omits SAM, BOB, reflection, commented-out code, and a few other places
This commit is contained in:
@ -62,7 +62,7 @@ public class ConfigFile {
|
||||
try {
|
||||
fileInputStream = new FileInputStream(_configFile);
|
||||
_properties.load(fileInputStream);
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
rv = false;
|
||||
} finally {
|
||||
if (fileInputStream != null) {
|
||||
@ -79,7 +79,7 @@ public class ConfigFile {
|
||||
try {
|
||||
fileOutputStream = new FileOutputStream(_configFile);
|
||||
_properties.store(fileOutputStream, null);
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
rv = false;
|
||||
} finally {
|
||||
if (fileOutputStream != null) {
|
||||
|
@ -88,14 +88,14 @@ public class SysTray implements SysTrayMenuListener {
|
||||
try {
|
||||
if (urlLauncher.openUrl(url))
|
||||
return;
|
||||
} catch (Exception ex) {
|
||||
} catch (RuntimeException ex) {
|
||||
// Fall through.
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (urlLauncher.openUrl(url, _browserString))
|
||||
return;
|
||||
} catch (Exception ex) {
|
||||
} catch (RuntimeException ex) {
|
||||
// Fall through.
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class UrlLauncher implements ClientApp {
|
||||
Thread.sleep(2*1000);
|
||||
} catch (InterruptedException ie) {}
|
||||
return true;
|
||||
} catch (Exception e) {}
|
||||
} catch (IOException e) {}
|
||||
if (System.currentTimeMillis() > done)
|
||||
break;
|
||||
try {
|
||||
@ -171,9 +171,9 @@ public class UrlLauncher implements ClientApp {
|
||||
* @return <code>true</code> if the operation was successful, otherwise
|
||||
* <code>false</code>.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
*/
|
||||
public boolean openUrl(String url) throws Exception {
|
||||
public boolean openUrl(String url) throws IOException {
|
||||
waitForServer(url);
|
||||
if (validateUrlFormat(url)) {
|
||||
String cbrowser = _context.getProperty(PROP_BROWSER);
|
||||
@ -217,7 +217,7 @@ public class UrlLauncher implements ClientApp {
|
||||
// No worries.
|
||||
}
|
||||
foo.delete();
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
// Defaults to IE.
|
||||
} finally {
|
||||
if (bufferedReader != null)
|
||||
@ -246,9 +246,9 @@ public class UrlLauncher implements ClientApp {
|
||||
* @return <code>true</code> if the operation was successful,
|
||||
* otherwise <code>false</code>.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
*/
|
||||
public boolean openUrl(String url, String browser) throws Exception {
|
||||
public boolean openUrl(String url, String browser) throws IOException {
|
||||
waitForServer(url);
|
||||
if (validateUrlFormat(url)) {
|
||||
if (_shellCommand.executeSilentAndWaitTimed(browser + " " + url, 5))
|
||||
@ -289,7 +289,7 @@ public class UrlLauncher implements ClientApp {
|
||||
String url = _args[0];
|
||||
openUrl(url);
|
||||
changeState(STOPPED);
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
changeState(CRASHED, e);
|
||||
}
|
||||
}
|
||||
@ -354,6 +354,6 @@ public class UrlLauncher implements ClientApp {
|
||||
launcher.openUrl(args[0]);
|
||||
else
|
||||
launcher.openUrl("http://127.0.0.1:7657/index.jsp");
|
||||
} catch (Exception e) {}
|
||||
} catch (IOException e) {}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user