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(); | ||||
|             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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue