Skip to content

Commit 9dc3bfa

Browse files
committed
Merge pull request processing#2865 from federicobond/misc-fixes
Miscellaneous fixes
2 parents 7988063 + cd23a32 commit 9dc3bfa

9 files changed

Lines changed: 12 additions & 18 deletions

File tree

app/src/processing/app/Preferences.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class Preferences {
6464
* Windows XP needs 66, and my Ubuntu machine needs 80+, so 80 seems proper.
6565
*/
6666
static public int BUTTON_WIDTH =
67-
Integer.valueOf(Language.text("preferences.button.width"));
67+
Integer.parseInt(Language.text("preferences.button.width"));
6868

6969
/** height of the EditorHeader, EditorToolbar, and EditorStatus */
7070
static final int GRID_SIZE = 32;

app/src/processing/app/tools/ColorSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ColorSelector implements Tool {
4343
* Only create one instance, otherwise we'll have dozens of animation
4444
* threads going if you open/close a lot of editor windows.
4545
*/
46-
static ColorChooser selector;
46+
private static volatile ColorChooser selector;
4747

4848
private Editor editor;
4949

app/src/processing/mode/java/PresentMode.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ public class PresentMode {
4949
//JMenu preferencesMenu;
5050
static JComboBox selector;
5151

52-
/**
53-
* Index of the currently selected display to be used for present mode.
54-
*/
55-
static GraphicsDevice device;
56-
5752

5853
static {
5954
GraphicsEnvironment environment =
@@ -75,7 +70,6 @@ public class PresentMode {
7570
selector.addActionListener(new ActionListener() {
7671
public void actionPerformed(ActionEvent e) {
7772
int index = selector.getSelectedIndex();
78-
//device = devices[index];
7973
Preferences.setInteger("run.present.display", index + 1);
8074
}
8175
});

core/src/processing/core/PApplet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,7 @@ public void updateListeners(Component comp) {
26372637
// protected int eventCount;
26382638

26392639

2640-
class InternalEventQueue {
2640+
static class InternalEventQueue {
26412641
protected Event queue[] = new Event[10];
26422642
protected int offset;
26432643
protected int count;
@@ -9049,7 +9049,7 @@ static public String[] split(String value, char delim) {
90499049
//}
90509050
if (splitCount == 0) {
90519051
String splits[] = new String[1];
9052-
splits[0] = new String(value);
9052+
splits[0] = value;
90539053
return splits;
90549054
}
90559055
//int pieceCount = splitCount + 1;

core/src/processing/core/PShapeSVG.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ public Font(PShapeSVG parent, XML properties) {
18141814
namedGlyphs.put(fg.name, fg);
18151815
}
18161816
if (fg.unicode != 0) {
1817-
unicodeGlyphs.put(new Character(fg.unicode), fg);
1817+
unicodeGlyphs.put(Character.valueOf(fg.unicode), fg);
18181818
}
18191819
}
18201820
glyphs[glyphCount++] = fg;
@@ -1848,7 +1848,7 @@ public void drawString(PGraphics g, String str, float x, float y, float size) {
18481848
char[] c = str.toCharArray();
18491849
for (int i = 0; i < c.length; i++) {
18501850
// call draw on each char (pulling it w/ the unicode table)
1851-
FontGlyph fg = unicodeGlyphs.get(new Character(c[i]));
1851+
FontGlyph fg = unicodeGlyphs.get(Character.valueOf(c[i]));
18521852
if (fg != null) {
18531853
fg.draw(g);
18541854
// add horizAdvX/unitsPerEm to the x coordinate along the way
@@ -1866,7 +1866,7 @@ public void drawChar(PGraphics g, char c, float x, float y, float size) {
18661866
float s = size / face.unitsPerEm;
18671867
g.translate(x, y);
18681868
g.scale(s, -s);
1869-
FontGlyph fg = unicodeGlyphs.get(new Character(c));
1869+
FontGlyph fg = unicodeGlyphs.get(Character.valueOf(c));
18701870
if (fg != null) g.shape(fg);
18711871
g.popMatrix();
18721872
}
@@ -1877,7 +1877,7 @@ public float textWidth(String str, float size) {
18771877
char[] c = str.toCharArray();
18781878
for (int i = 0; i < c.length; i++) {
18791879
// call draw on each char (pulling it w/ the unicode table)
1880-
FontGlyph fg = unicodeGlyphs.get(new Character(c[i]));
1880+
FontGlyph fg = unicodeGlyphs.get(Character.valueOf(c[i]));
18811881
if (fg != null) {
18821882
w += (float) fg.horizAdvX / face.unitsPerEm;
18831883
}

core/src/processing/data/JSONObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ static protected Object stringToValue(String string) {
14921492
return d;
14931493
}
14941494
} else {
1495-
Long myLong = new Long(string);
1495+
Long myLong = Long.valueOf(string);
14961496
if (myLong.longValue() == myLong.intValue()) {
14971497
return Integer.valueOf(myLong.intValue());
14981498
} else {

core/src/processing/data/Table.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3862,7 +3862,7 @@ protected void checkBounds(int row, int column) {
38623862
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38633863

38643864

3865-
class HashMapBlows {
3865+
static class HashMapBlows {
38663866
HashMap<String,Integer> dataToIndex = new HashMap<String, Integer>();
38673867
ArrayList<String> indexToData = new ArrayList<String>();
38683868

core/src/processing/opengl/PJOGL.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ protected Tessellator createTessellator(TessellatorCallback callback) {
12031203
}
12041204

12051205

1206-
protected class Tessellator implements PGL.Tessellator {
1206+
protected static class Tessellator implements PGL.Tessellator {
12071207
protected GLUtessellator tess;
12081208
protected TessellatorCallback callback;
12091209
protected GLUCallback gluCallback;

core/src/processing/opengl/PShader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ protected void setPointAttribute(int vboId, int size, int type,
14381438
//
14391439
// Class to store a user-specified value for a uniform parameter
14401440
// in the shader
1441-
protected class UniformValue {
1441+
protected static class UniformValue {
14421442
static final int INT1 = 0;
14431443
static final int INT2 = 1;
14441444
static final int INT3 = 2;

0 commit comments

Comments
 (0)