~ubuntu-branches/ubuntu/precise/commons-csv/precise

« back to all changes in this revision

Viewing changes to src/java/org/apache/commons/csv/writer/CSVWriter.java

  • Committer: Bazaar Package Importer
  • Author(s): Jan-Pascal van Best
  • Date: 2008-09-10 20:58:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080910205800-ohoq6075nafu8n2b
Tags: upstream-0.1-SNAPSHOT+svn678580
ImportĀ upstreamĀ versionĀ 0.1-SNAPSHOT+svn678580

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        try {
51
51
            StringBuffer sb = new StringBuffer();
52
52
            for (int i = 0; i < fields.length; i++) {
53
 
                String value = (String) map.get(fields[i].getName());
54
 
                value = writeValue(fields[i], value);
55
 
                sb.append(value);
 
53
                Object o = map.get(fields[i].getName());
 
54
                if (o != null) {
 
55
                    String value = o.toString();
 
56
                    value = writeValue(fields[i], value);
 
57
                    sb.append(value);
 
58
                }
56
59
                if (!config.isDelimiterIgnored() && fields.length != (i+1)) {
57
60
                    sb.append(config.getDelimiter());
58
61
                }