Details

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

      Description

      CSVPrinter has a lot of problems to fix, from efficiency, to not producing well-formed CSV.

      1. SANDBOX-322.patch
        34 kB
        Yonik Seeley

        Activity

        Yonik Seeley created issue -
        Hide
        Yonik Seeley added a comment -

        Patch attached. Overview of changes:

        • CSVPrinter no longer wraps the provided writer in a PrintWriter... the reason is that the passed writer can often be more efficient than PrintWriter.
        • CSVPrinter no longer flushes all of the time - that should be up to the user
        • users have access to the lowest level if desired... ability to pass a char[] + length/offset
        • rewrote the output methods: writing no longer uses a StringBuffer, and writes are done in big chunks, not character-by-character
        • removed the use of the system property "line.separator" - local specific behavior should normally be avoided. A printerNewline was added to the strategy instead.
        • in CSVParser, only throw away leading whitespace if the strategy calls for it
        • added round-trip testing with random strings to ensure that encapsulation and escaping strategies can be both correctly encoded and then decoded with no loss of information.

        During testing, I hit an issue where the tests ran fine in my IDE, but failed for "mvn test". I tracked this down to the fact that many tests were actually changing the default strategy object. This test code was changed to make a clone if they were going to change it.

        Show
        Yonik Seeley added a comment - Patch attached. Overview of changes: CSVPrinter no longer wraps the provided writer in a PrintWriter... the reason is that the passed writer can often be more efficient than PrintWriter. CSVPrinter no longer flushes all of the time - that should be up to the user users have access to the lowest level if desired... ability to pass a char[] + length/offset rewrote the output methods: writing no longer uses a StringBuffer, and writes are done in big chunks, not character-by-character removed the use of the system property "line.separator" - local specific behavior should normally be avoided. A printerNewline was added to the strategy instead. in CSVParser, only throw away leading whitespace if the strategy calls for it added round-trip testing with random strings to ensure that encapsulation and escaping strategies can be both correctly encoded and then decoded with no loss of information. During testing, I hit an issue where the tests ran fine in my IDE, but failed for "mvn test". I tracked this down to the fact that many tests were actually changing the default strategy object. This test code was changed to make a clone if they were going to change it.
        Yonik Seeley made changes -
        Field Original Value New Value
        Attachment SANDBOX-322.patch [ 12447049 ]
        Hide
        Yonik Seeley added a comment -

        committed.

        Show
        Yonik Seeley added a comment - committed.
        Yonik Seeley made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s CSV 1.0 [ 12313514 ]
        Resolution Fixed [ 1 ]
        Emmanuel Bourg made changes -
        Project Commons Sandbox [ 12310491 ] Commons CSV [ 12313222 ]
        Key SANDBOX-322 CSV-45
        Component/s CSV [ 12311182 ]
        Fix Version/s 1.0 [ 12320161 ]
        Fix Version/s CSV 1.0 [ 12313514 ]
        Emmanuel Bourg made changes -
        Component/s Printer [ 12317719 ]
        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
        1d 22h 7m 1 Yonik Seeley 16/Jun/10 17:13
        Resolved Resolved Closed Closed
        1520d 3h 52m 1 Benedikt Ritter 14/Aug/14 21:06

          People

          • Assignee:
            Unassigned
            Reporter:
            Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development