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)