mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
Use valueOf factory method instead of constructor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user