OFBiz
  1. OFBiz
  2. OFBIZ-4837

Separator Error in data file tools

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: SVN trunk
    • Fix Version/s: None
    • Component/s: framework
    • Labels:

      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. dataDefinition.xml
        0.5 kB
        Gil Portenseigne
      3. dataSample.csv
        0.1 kB
        Gil Portenseigne
      4. result.xml
        0.2 kB
        Gil Portenseigne
      5. OFBIZ-4837.patch
        0.8 kB
        Gil Portenseigne
      6. OFBIZ-4837_2.patch
        0.9 kB
        Gil Portenseigne

        Activity

        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
        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
        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 -

        The patch

        Show
        Gil Portenseigne added a comment - The patch
        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

          People

          • Assignee:
            Unassigned
            Reporter:
            Gil Portenseigne
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

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

                Development