Author: deepak Date: Sat Apr 18 06:40:32 2015 New Revision: 1674447 URL: http://svn.apache.org/r1674447 Log: Applied patch from jira issue OFBIZ-4837 - Separator Error in data file tools.
Thanks Gil Portenseigne for reporting and providing the patch for the issue, Thanks Aditya for uploading the update patch and verifying it. Modified: ofbiz/trunk/framework/datafile/src/org/ofbiz/datafile/Record.java Modified: ofbiz/trunk/framework/datafile/src/org/ofbiz/datafile/Record.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/datafile/src/org/ofbiz/datafile/Record.java?rev=1674447&r1=1674446&r2=1674447&view=diff ============================================================================== --- ofbiz/trunk/framework/datafile/src/org/ofbiz/datafile/Record.java (original) +++ ofbiz/trunk/framework/datafile/src/org/ofbiz/datafile/Record.java Sat Apr 18 06:40:32 2015 @@ -580,7 +580,14 @@ public class Record implements Serializa } } try { - if (textDelimiter != null && (strVal.startsWith(textDelimiter) && strVal.endsWith(textDelimiter))) { + if (textDelimiter != null && strVal != null && (strVal.startsWith(textDelimiter) && (!strVal.endsWith(textDelimiter) || strVal.length()==1))) { + strVal = strVal.concat(""+delimiter); + while (!strVal.endsWith(textDelimiter)) { + strVal = strVal.concat(st.nextToken()); + } + st.nextToken(); + } + if (textDelimiter != null && strVal != null && (strVal.startsWith(textDelimiter) && strVal.endsWith(textDelimiter))) { strVal = strVal.substring(textDelimiter.length(), strVal.length() - textDelimiter.length()); } record.setString(modelField.name, strVal);