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:
parent
77f84e9162
commit
8f53076707
2 changed files with 11 additions and 4 deletions
|
@ -1442,7 +1442,10 @@ public final class Application implements IPathElement, Runnable {
|
||||||
|
|
||||||
long sleepInterval = CronJob.millisToNextFullMinute();
|
long sleepInterval = CronJob.millisToNextFullMinute();
|
||||||
try {
|
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) {}
|
} catch (Exception ignore) {}
|
||||||
|
|
||||||
// sleep until the next full minute
|
// sleep until the next full minute
|
||||||
|
|
|
@ -517,9 +517,13 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
HashMap parameters = new HashMap();
|
HashMap parameters = new HashMap();
|
||||||
|
|
||||||
// Parse any query string parameters from the request
|
// Parse any query string parameters from the request
|
||||||
|
String queryString = request.getQueryString();
|
||||||
|
if (queryString != null) {
|
||||||
try {
|
try {
|
||||||
parseParameters(parameters, request.getQueryString().getBytes(), encoding);
|
parseParameters(parameters, queryString.getBytes(), encoding);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
System.err.println("Error parsing query string: "+e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse any posted parameters in the input stream
|
// Parse any posted parameters in the input stream
|
||||||
|
|
Loading…
Add table
Reference in a new issue