diff options
author | Andreas Buchen | 2008-11-21 07:49:43 +0000 |
---|---|---|
committer | Andreas Buchen | 2008-11-21 07:49:43 +0000 |
commit | d19d33e9036a0e9b96c2ce057fbc103ed1ab1567 (patch) | |
tree | 84d5d74dbb2f39d415c92f90f312e6932bf5dd5d | |
parent | a217adb0778d7f915c31a5b1cd170e275840d51a (diff) | |
download | org.eclipse.mat-d19d33e9036a0e9b96c2ce057fbc103ed1ab1567.tar.gz org.eclipse.mat-d19d33e9036a0e9b96c2ce057fbc103ed1ab1567.tar.xz org.eclipse.mat-d19d33e9036a0e9b96c2ce057fbc103ed1ab1567.zip |
fix: CSV separator char depends on locale
-rw-r--r-- | plugins/org.eclipse.mat.report/src/org/eclipse/mat/report/internal/CSVOutputter.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/org.eclipse.mat.report/src/org/eclipse/mat/report/internal/CSVOutputter.java b/plugins/org.eclipse.mat.report/src/org/eclipse/mat/report/internal/CSVOutputter.java index e5144347..c0c57ed6 100644 --- a/plugins/org.eclipse.mat.report/src/org/eclipse/mat/report/internal/CSVOutputter.java +++ b/plugins/org.eclipse.mat.report/src/org/eclipse/mat/report/internal/CSVOutputter.java @@ -13,6 +13,7 @@ package org.eclipse.mat.report.internal; import java.io.IOException;
import java.io.Writer;
import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
import java.text.Format;
import java.util.List;
@@ -29,7 +30,7 @@ import org.eclipse.mat.report.Renderer; @Renderer(target = "csv", result = { IResultTree.class, IResultTable.class })
public class CSVOutputter implements IOutputter
{
- private static final String SEPARATOR = ";";
+ private static final char SEPARATOR = new DecimalFormatSymbols().getDecimalSeparator() == ',' ? ';' : ',';
public void process(Context context, IResult result, Writer writer) throws IOException
{
@@ -107,6 +108,9 @@ public class CSVOutputter implements IOutputter private String getStringValue(Object columnValue, Filter.ValueConverter converter)
{
+ if (columnValue == null)
+ return "";
+
// check first the format: the converter can change the type to double!
Format fmt = null;
if (columnValue instanceof Long || columnValue instanceof Integer)
|