metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Sørensen (JIRA) <j...@apache.org>
Subject [jira] [Created] (METAMODEL-30) CsvDataContext.executeCountQuery breaks if Resource.getSize() returns -1
Date Tue, 19 Nov 2013 13:45:20 GMT
Kasper Sørensen created METAMODEL-30:
----------------------------------------

             Summary: CsvDataContext.executeCountQuery breaks if Resource.getSize() returns
-1
                 Key: METAMODEL-30
                 URL: https://issues.apache.org/jira/browse/METAMODEL-30
             Project: Metamodel
          Issue Type: Bug
            Reporter: Kasper Sørensen
            Assignee: Kasper Sørensen


On line 282 of CsvDataContext we check the size of the CSV resource (typically file) like
this:

final long length = _resource.getSize();

But the Resource interface says that a resource may return -1 to this method, if the size
is not determinable.

In that case our code breaks since there will eventually be a negative sample data array created
from this value.

Rather we should check for the exceptional -1 value and handle the sample array size accordingly.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message