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:
zzz
2015-11-12 18:49:13 +00:00
parent 37a4fcb469
commit 51c5da3f72
78 changed files with 235 additions and 136 deletions

View File

@@ -862,7 +862,7 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2
if ((duration > 100) && _log.shouldLog(Log.INFO))
_log.info("Message availability notification for " + msgId.intValue() + " took "
+ duration + " to " + _sessionListener);
} catch (Exception e) {
} catch (RuntimeException e) {
_log.log(Log.CRIT, "Error notifying app of message availability", e);
}
} else {

View File

@@ -399,7 +399,7 @@ class I2PSessionMuxedImpl extends I2PSessionImpl2 {
try {
_demultiplexer.messageAvailable(I2PSessionMuxedImpl.this,
msg.id, msg.size, msg.proto, msg.fromPort, msg.toPort);
} catch (Exception e) {
} catch (RuntimeException e) {
_log.error("Error notifying app of message availability", e);
}
}

View File

@@ -91,7 +91,7 @@ public class SingleFileNamingService extends NamingService {
key = getKey(hostname.substring(4));
if (key != null)
return lookupBase64(key);
} catch (Exception ioe) {
} catch (IOException ioe) {
if (_file.exists())
_log.error("Error loading hosts file " + _file, ioe);
else if (_log.shouldLog(Log.WARN))
@@ -123,7 +123,7 @@ public class SingleFileNamingService extends NamingService {
return line.substring(0, split);
}
return null;
} catch (Exception ioe) {
} catch (IOException ioe) {
if (_file.exists())
_log.error("Error loading hosts file " + _file, ioe);
else if (_log.shouldLog(Log.WARN))