OFBiz
  1. OFBiz
  2. OFBIZ-4837

Separator Error in data file tools

    Details

    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      In https://demo-trunk.ofbiz.apache.org/webtools/control/viewdatafile

      There is a bug when defining simple separator (for instance ",") in definition file, and when in data file a string data contains the separator. This one sould not be interpreted in data parsing.

      To illustrate a bit more, i add small sample files to reproduce the problem.
      And the patch which fix the bug.

      1. resultBefore.xml
        0.2 kB
        Gil Portenseigne
      2. result.xml
        0.2 kB
        Gil Portenseigne
      3. OFBIZ-4837.patch
        0.8 kB
        Gil Portenseigne
      4. OFBIZ-4837.patch
        1 kB
        Aditya Patwa
      5. OFBIZ-4837_2.patch
        0.9 kB
        Gil Portenseigne
      6. dataSample.csv
        0.1 kB
        Gil Portenseigne
      7. dataDefinition.xml
        0.5 kB
        Gil Portenseigne

        Activity

        Hide
        Gil Portenseigne added a comment -

        definition and sample befor the fix give the resultBefore file.

        With the fix, result.xml is obtained

        Show
        Gil Portenseigne added a comment - definition and sample befor the fix give the resultBefore file. With the fix, result.xml is obtained
        Hide
        Gil Portenseigne added a comment -

        The patch

        Show
        Gil Portenseigne added a comment - The patch
        Hide
        Gil Portenseigne added a comment -

        I didn't comment the code :
        I add strVal != null, to avoid NPE
        The while loop is here to concatene the string value until the ending string separator is found.

        Show
        Gil Portenseigne added a comment - I didn't comment the code : I add strVal != null, to avoid NPE The while loop is here to concatene the string value until the ending string separator is found.
        Hide
        Gil Portenseigne added a comment -

        Second version of patch taking care of specific case, when the separator is the first character after the string separator.

        Show
        Gil Portenseigne added a comment - Second version of patch taking care of specific case, when the separator is the first character after the string separator.
        Hide
        Erwan de FERRIERES added a comment -

        Hi Gil,

        there is no need to rename your patches, Jira is directly deactivating the oldest one.
        Also, maybe the best test to explain your work is to add unit tests.

        thanks

        Show
        Erwan de FERRIERES added a comment - Hi Gil, there is no need to rename your patches, Jira is directly deactivating the oldest one. Also, maybe the best test to explain your work is to add unit tests. thanks
        Hide
        Aditya Patwa added a comment -

        Updated the OFBIZ-4837.patch, as the OFBIZ-4837_2.patch was failing due to changes in Record.java. Here is the updated patch. I also tested and verified it on my local machine.

        Show
        Aditya Patwa added a comment - Updated the OFBIZ-4837 .patch, as the OFBIZ-4837 _2.patch was failing due to changes in Record.java. Here is the updated patch. I also tested and verified it on my local machine.
        Hide
        Deepak Dixit added a comment -

        Thanks Gil Portenseigne and Aditya.
        Your patch has been committed at following revision:

        Trunk at r#1674447
        14.12 at r#1674448
        13.07 at r#1674449
        12.04 at r#1674450

        Show
        Deepak Dixit added a comment - Thanks Gil Portenseigne and Aditya. Your patch has been committed at following revision: Trunk at r#1674447 14.12 at r#1674448 13.07 at r#1674449 12.04 at r#1674450

          People

          • Assignee:
            Deepak Dixit
            Reporter:
            Gil Portenseigne
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.5h
              0.5h
              Remaining:
              Remaining Estimate - 0.5h
              0.5h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development

                  Agile