Bug 58541

Summary: CGIServlet and WebdavServlet code improvements
Product: Tomcat 8 Reporter: Anthony Whitford <anthony>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: trivial    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: Macintosh   
OS: Mac OS X 10.1   
Attachments: Code improvements to two Servlet classes

Description Anthony Whitford 2015-10-25 22:29:17 UTC
Created attachment 33213 [details]
Code improvements to two Servlet classes

Noticed some opportunities:

'String.indexOf(char)' is faster than 'String.indexOf(string)'
'Integer.parseInt(s)' is more efficient than 'new Integer(s).intValue()'
'Integer.valueOf(i)' may be more efficient than 'new Integer(i)'
'Integer.toString(i)' is more efficient than 'Integer.valueOf(i).toString()'
Comment 1 Mark Thomas 2015-11-03 09:18:50 UTC
Issues fixed across the code base rather than just these 2 classes.

Fixed in trunk, 8.0.x (for 8.0.29 onwards) and 7.0.x (for 7.0.66 onwards).