Opened 18 years ago

Closed 18 years ago

#563 closed defect (fixed)

FlatFileParser can't handle complex mappings

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: BASE 2.2.3
Component: core Version:
Keywords: Cc:

Description

If you for example create a column mapping as '\Ch1 B Mean\ ' (note the extra space) you will get the following exception when importing data with it:

java.lang.NullPointerException
at net.sf.basedb.util.parser.ConstantMapper.<init>(ConstantMapper.java:70)
at net.sf.basedb.util.parser.FlatFileParser.getMapper(FlatFileParser.java:865)
at net.sf.basedb.util.parser.FlatFileParser.getMapper(FlatFileParser.java:789)
at net.sf.basedb.plugins.AbstractFlatFileImporter.getMapper(AbstractFlatFileImporter.java:870)
at net.sf.basedb.plugins.RawDataFlatFileImporter.beginData(RawDataFlatFileImporter.java:489)
at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:562)
at net.sf.basedb.plugins.AbstractFlatFileImporter.run(AbstractFlatFileImporter.java:442)
at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:88)
at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:420)
at java.lang.Thread.run(Thread.java:595)

The problem is that the number parser is applied to the trailing space. This generates an exception since it is not a number. On the other hand, if this had been handled correctly, the CompoundMapper that is later putting together the result is not using the number formatter. This must also be fixed.

In this case the result would still be an error (NumberFormatException), since the space is still not a number.

For more info see mailarchive: http://sourceforge.net/mailarchive/forum.php?thread_name=3C9D549F0263E24D92C4F9FA2933260F2DEA84%40EMAIL01.pnl.gov&forum_name=basedb-users

Change History (1)

comment:1 by Nicklas Nordborg, 18 years ago

Resolution: fixed
Status: newclosed

(In [3241]) Fixes #563: FlatFileParser can't handle complex mappings

Note: See TracTickets for help on using tickets.