|
19 | 19 | import java.io.Writer;
|
20 | 20 | import java.util.Arrays;
|
21 | 21 | import java.util.Comparator;
|
| 22 | +import java.util.Locale; |
22 | 23 | import java.util.SortedMap;
|
23 | 24 | import java.util.TreeMap;
|
24 | 25 |
|
|
29 | 30 | public abstract class GenericFlameGraphGenerator {
|
30 | 31 |
|
31 | 32 | private static final GenericStackElement[] ROOT = new GenericStackElement[0];
|
32 |
| - |
| 33 | + private static final Locale SVG_LOCALE; |
| 34 | + static { |
| 35 | + SVG_LOCALE = Locale.ROOT; |
| 36 | + } |
| 37 | + |
33 | 38 | private Node root;
|
34 | 39 |
|
35 | 40 | private FlameColorPicker colorPicker = new DefaultColorPicker();
|
@@ -122,7 +127,7 @@ private void renderNode(Writer writer, Node node, int x, int height, int width,
|
122 | 127 | escape(describe(node)), node.totalCount, 100d * node.totalCount / root.totalCount);
|
123 | 128 | format(writer, "<rect x=\"%.1f\" y=\"%.1f\" width=\"%.1f\" height=\"%.1f\" fill=\"rgb(%d,%d,%d)\" rx=\"2\" ry=\"2\"/>\n",
|
124 | 129 | rx, ry, rw, rh, cr, cg, cb);
|
125 |
| - format(writer, "<text text-anchor=\"\" x=\"%.1f\" y=\"%.1f\" fill=\"rgb(0,0,0)\">%s</text>\n", |
| 130 | + format(writer, "<text x=\"%.1f\" y=\"%.1f\" fill=\"rgb(0,0,0)\">%s</text>\n", |
126 | 131 | rx + 10, ry + frameheight - 3, escape(trimStr(describe(node), (int)(rw - 10) / 7)));
|
127 | 132 | format(writer, "</g>\n");
|
128 | 133 |
|
@@ -171,7 +176,7 @@ protected String escape(String text) {
|
171 | 176 | protected abstract String describe(Node node);
|
172 | 177 |
|
173 | 178 | private void format(Writer writer, String format, Object... args) throws IOException {
|
174 |
| - writer.append(String.format(format, args)); |
| 179 | + writer.append(String.format(SVG_LOCALE, format, args)); |
175 | 180 | }
|
176 | 181 |
|
177 | 182 | protected void appendHeader(int width, int height, Writer writer) throws IOException {
|
|
0 commit comments