Commons CSV
  1. Commons CSV
  2. CSV-25

CSVParser.nextValue() seems pointless

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: Parser
    • Labels:
      None

      Description

      The nextValue method really doesn't seem very useful. There's no concept of end of line, so your csv file could be 1xn or nx1 and you wouldn't know.

        Issue Links

          Activity

          Henri Yandell created issue -
          Hide
          Henri Yandell added a comment -

          Digging into the code - I think it returns a string containing a newline of some kind to indicate end of line. It is doing something for end of line, but I imagine it's not much fun to code against. Still thinking the method needs a big overhaul.

          Maybe delete for 1.0 and make it a feature for 1.x.

          Show
          Henri Yandell added a comment - Digging into the code - I think it returns a string containing a newline of some kind to indicate end of line. It is doing something for end of line, but I imagine it's not much fun to code against. Still thinking the method needs a big overhaul. Maybe delete for 1.0 and make it a feature for 1.x.
          Henri Yandell made changes -
          Field Original Value New Value
          Fix Version/s CSV 1.0 [ 12313514 ]
          Hide
          Bob Smith added a comment -

          It would be useful if the getLineNumber() method returned the current line in the output instead of the current line in the reader (since they would be different if there is a multi-line value). Then you could use that method to tell which line the value is on.

          And if I'm looking at it correctly, the only special value it returns is null when it gets to the end of the file (which would be how you know that there are no more values).

          Show
          Bob Smith added a comment - It would be useful if the getLineNumber() method returned the current line in the output instead of the current line in the reader (since they would be different if there is a multi-line value). Then you could use that method to tell which line the value is on. And if I'm looking at it correctly, the only special value it returns is null when it gets to the end of the file (which would be how you know that there are no more values).
          Peter Koszek made changes -
          Link This issue blocks SANDBOX-283 [ SANDBOX-283 ]
          Hide
          Jacopo Cappellato added a comment -

          I agree that the method doesn't seem very useful; as far as I understand when an end of line is reached the method returns (as the end result of the chain ) an empty string "".
          In this way it is not possible to figure out when a line begins.
          I guess that it can be useful in some special cases, for example when the data in the csv file is structured in a way (for example if the first value of each line has a given prefix) that can be used by the calling method to figure out the new lines.
          This is not probably a big deal and it can be improved in a future release.

          Show
          Jacopo Cappellato added a comment - I agree that the method doesn't seem very useful; as far as I understand when an end of line is reached the method returns (as the end result of the chain ) an empty string "". In this way it is not possible to figure out when a line begins. I guess that it can be useful in some special cases, for example when the data in the csv file is structured in a way (for example if the first value of each line has a given prefix) that can be used by the calling method to figure out the new lines. This is not probably a big deal and it can be improved in a future release.
          Hide
          Emmanuel Bourg added a comment -

          I agree as well, unless lines are too long to fit in memory there is no point keeping this method.

          Show
          Emmanuel Bourg added a comment - I agree as well, unless lines are too long to fit in memory there is no point keeping this method.
          Emmanuel Bourg made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Emmanuel Bourg made changes -
          Project Commons Sandbox [ 12310491 ] Commons CSV [ 12313222 ]
          Key SANDBOX-220 CSV-25
          Component/s CSV [ 12311182 ]
          Fix Version/s 1.0 [ 12320161 ]
          Fix Version/s CSV 1.0 [ 12313514 ]
          Emmanuel Bourg made changes -
          Component/s Parser [ 12317718 ]
          Gavin made changes -
          Link This issue blocks CSV-32 [ CSV-32 ]
          Gavin made changes -
          Link This issue is depended upon by CSV-32 [ CSV-32 ]
          Benedikt Ritter made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1348d 6h 27m 1 Emmanuel Bourg 09/Nov/11 14:54
          Resolved Resolved Closed Closed
          1009d 5h 11m 1 Benedikt Ritter 14/Aug/14 21:06

            People

            • Assignee:
              Unassigned
              Reporter:
              Henri Yandell
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development