DBaseFileReader inefficient try/catch
-------------------------------------

                 Key: GEOT-2850
                 URL: http://jira.codehaus.org/browse/GEOT-2850
             Project: GeoTools
          Issue Type: Bug
          Components: data shapefile
    Affects Versions: 2.6.0
            Reporter: Stefan Alfons Krüger
            Assignee: Andrea Aime
             Fix For: 2.6.1
         Attachments: DbaseNumberExceptionHandling.patch

we have something like

try {
 if (isInteger) int.parse(string)
 else if (isLong) long.parse(string)
catch (NumberEx e){
 // Try as long now...
 (long) long.parse(string)
}

So if it defined as long and fails to be parsed as a long, the code tries the 
same thing again.. wasting time...

A patch for 2.6.x is attached that saves one try/catch/parse. I tried the patch 
with my code and the speed difference was measurable...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to