Re: Error in DbfInputStream ?!

From: Don Dietrick <dietrick@bbn.com>
Date: Thu Oct 10 2002 - 17:24:03 EDT

Thanks guys, I've added the fix to the next release.

- Don

On Wednesday, October 9, 2002, at 09:01 AM, Lonnie D. Goad wrote:

> Sorry, I didn't read your previous mail sooner. I too had to make this
> change.
>
> -----Original Message-----
> From: owner-openmap-users@bbn.com [mailto:owner-openmap-users@bbn.com]
> On Behalf Of Gubler, Rüdiger
> Sent: Wednesday, October 09, 2002 4:47 AM
> To: Openmap-Users (E-Mail); Don Dietrick (E-Mail)
> Subject: AW: Error in DbfInputStream ?!
>
>
>
> Hello,
>
> i changed ind the readData() method in DbfInputStream the part
>
> if(type == DbfTableModel.TYPE_NUMERIC)
> {
> String cell = _leis.readString(length);
> record.add(c, new Double(cell));
> }
> else
> {
> String cell = _leis.readString(length);
> record.add(c, cell);
> }
>
> to
>
> String cell = _leis.readString(length);
> if(type == DbfTableModel.TYPE_NUMERIC && !cell.equals( "" ) )
> { ^^^^^^^^^^^^^^^^^^^^^
> record.add(c, new Double(cell));
> }
> else
> {
> record.add(c, cell);
> }
>
> Now it works. Could you fix this in the next release?
>
>
> Yours Ruediger
>
>
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: Gubler, Rüdiger
>> Gesendet: Dienstag, 8. Oktober 2002 12:28
>> An: Openmap-Users (E-Mail); Don Dietrick (E-Mail)
>> Betreff: Error in DbfInputStream ?!
>>
>>
>>
>> Hello,
>>
>> while opening the attached file i get the following exception:
>>
>> java.lang.NumberFormatException: empty String
>> at
>> java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal
>> .java:989)
>> at java.lang.Double.valueOf(Double.java:168)
>> at java.lang.Double.<init>(Double.java:240)
>> at
>> com.bbn.openmap.dataAccess.shape.input.DbfInputStream.readData
>> (Unknown Source)
>> at
>> com.bbn.openmap.dataAccess.shape.input.DbfInputStream.<init>(U
>> nknown Source)
>> at test.MainTest.main(MainTest.java:23)
>>
>>
>>
>> My code:
>>
>>
>> import java.io.FileInputStream;
>> import java.util.Iterator;
>> import java.util.List;
>>
>> import com.bbn.openmap.dataAccess.shape.input.DbfInputStream;
>>
>> public class MainTest
>> {
>>
>> public static void main(String[] args)
>> {
>> FileInputStream fis;
>> DbfInputStream dbfIS;
>> List dataList, dataRow;
>> Iterator it, it2;
>> String[] columnNames;
>>
>> try
>> {
>> fis = new FileInputStream( "C:/test.dbf" );
>> dbfIS = new DbfInputStream( fis );
>>
>> dataList = dbfIS.getRecords();
>>
>> columnNames = dbfIS.getColumnNames();
>>
>> for( int ii = 0; ii < columnNames.length; ii++ )
>> {
>> System.err.print( columnNames[ii] + (ii <
>> columnNames.length - 1 ? ", " : "\n") );
>> }
>>
>> it = dataList.iterator();
>> while( it.hasNext() )
>> {
>> dataRow = (List)it.next();
>>
>> it2 = dataRow.iterator();
>> while( it2.hasNext() )
>> {
>> System.err.print( it2.next() + (it2.hasNext() ? ",
>> " : "\n") );
>> }
>>
>> }
>>
>> }
>> catch( Exception ex )
>> {
>> ex.printStackTrace();
>> }
>>
>> }
>>
>> }
>>
>>
>>
>>
>>
>> Yours Ruediger
>>
>>
>>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Oct 10 17:26:55 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT