Use valueOf factory method instead of constructor

This commit is contained in:
Federico Bond
2014-09-14 21:02:29 -03:00
parent c2c1f1a216
commit 69b5953203
2 changed files with 5 additions and 5 deletions

View File

@@ -1811,7 +1811,7 @@ public class PShapeSVG extends PShape {
namedGlyphs.put(fg.name, fg);
}
if (fg.unicode != 0) {
unicodeGlyphs.put(new Character(fg.unicode), fg);
unicodeGlyphs.put(Character.valueOf(fg.unicode), fg);
}
}
glyphs[glyphCount++] = fg;
@@ -1845,7 +1845,7 @@ public class PShapeSVG extends PShape {
char[] c = str.toCharArray();
for (int i = 0; i < c.length; i++) {
// call draw on each char (pulling it w/ the unicode table)
FontGlyph fg = unicodeGlyphs.get(new Character(c[i]));
FontGlyph fg = unicodeGlyphs.get(Character.valueOf(c[i]));
if (fg != null) {
fg.draw(g);
// add horizAdvX/unitsPerEm to the x coordinate along the way
@@ -1863,7 +1863,7 @@ public class PShapeSVG extends PShape {
float s = size / face.unitsPerEm;
g.translate(x, y);
g.scale(s, -s);
FontGlyph fg = unicodeGlyphs.get(new Character(c));
FontGlyph fg = unicodeGlyphs.get(Character.valueOf(c));
if (fg != null) g.shape(fg);
g.popMatrix();
}
@@ -1874,7 +1874,7 @@ public class PShapeSVG extends PShape {
char[] c = str.toCharArray();
for (int i = 0; i < c.length; i++) {
// call draw on each char (pulling it w/ the unicode table)
FontGlyph fg = unicodeGlyphs.get(new Character(c[i]));
FontGlyph fg = unicodeGlyphs.get(Character.valueOf(c[i]));
if (fg != null) {
w += (float) fg.horizAdvX / face.unitsPerEm;
}

View File

@@ -1492,7 +1492,7 @@ public class JSONObject {
return d;
}
} else {
Long myLong = new Long(string);
Long myLong = Long.valueOf(string);
if (myLong.longValue() == myLong.intValue()) {
return Integer.valueOf(myLong.intValue());
} else {