Do not frivolously use Exceptions in place of basic null checks

as proposed by Stefan Matthias Aust on the mailing list.
This commit is contained in:
hns 2003-07-04 13:43:18 +00:00
parent 77f84e9162
commit 8f53076707
2 changed files with 11 additions and 4 deletions

View file

@ -1442,7 +1442,10 @@ public final class Application implements IPathElement, Runnable {
long sleepInterval = CronJob.millisToNextFullMinute();
try {
sleepInterval = Integer.parseInt(props.getProperty("schedulerInterval"))*1000;
String sleepProp = props.getProperty("schedulerInterval");
if (sleepProp != null) {
sleepInterval = Math.max(1000, Integer.parseInt(sleepProp)*1000);
}
} catch (Exception ignore) {}
// sleep until the next full minute

View file

@ -517,9 +517,13 @@ public abstract class AbstractServletClient extends HttpServlet {
HashMap parameters = new HashMap();
// Parse any query string parameters from the request
try {
parseParameters(parameters, request.getQueryString().getBytes(), encoding);
} catch (Exception e) {
String queryString = request.getQueryString();
if (queryString != null) {
try {
parseParameters(parameters, queryString.getBytes(), encoding);
} catch (Exception e) {
System.err.println("Error parsing query string: "+e);
}
}
// Parse any posted parameters in the input stream