On Tue, Dec 9, 2008 at 4:56 PM, Brett Henderson <[EMAIL PROTECTED]> wrote:

> Karl Newman wrote:
>
>> The SRTM data has no timestamps, which is causing the problem. So you only
>> need to set enableDateParsing=false for that file. It might be good to show
>> a warning if an entity has no timestamp attribute in the XML. I propose
>> adding the following lines in BaseElementProcessor.java:
>>
>> +    private static final Logger log =
>> Logger.getLogger(BaseElementProcessor.class.getName());
>>
>> ...
>>
>>    protected TimestampContainer createTimestampContainer(String data) {
>>        if (enableDateParsing) {
>> +            if (data == null || data == "") {
>> +                log.warning("Element missing timestamp attribute.");
>> +            }
>>            return new UnparsedTimestampContainer(timestampFormat, data);
>>        } else {
>>            return dummyTimestampContainer;
>>        }
>>    }
>>
> Cool, I agree that this is the place to do it.  It avoids subsequently fail
> 3 tasks down the pipeline because input data was dodgy.
>
> I'd rather not just log a warning though because nobody reads them and it's
> going to fail anyway.  I'd prefer to just make it abort at that point.


The reason I went with a warning instead of an exception is that I thought
there were some possible downstream tasks that didn't need the timestamps.
But that's an oddball file that doesn't have timestamps, anyway, so maybe an
exception is the right way to go.

Karl
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev

Reply via email to