Skip to content

Commit 7c4544a

Browse files
committed
Add static modifier to inner classes that don't access parent
1 parent 8efee02 commit 7c4544a

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

app/src/processing/app/ColorChooser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ public void keyPressed() {
639639
/**
640640
* Extension of JTextField that only allows numbers
641641
*/
642-
class NumberField extends JTextField {
642+
static class NumberField extends JTextField {
643643

644644
public boolean allowHex;
645645

@@ -672,7 +672,7 @@ public Dimension getMaximumSize() {
672672
/**
673673
* Document model to go with JTextField that only allows numbers.
674674
*/
675-
class NumberDocument extends PlainDocument {
675+
static class NumberDocument extends PlainDocument {
676676

677677
NumberField parentField;
678678

app/src/processing/app/EditorHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ public Dimension getMaximumSize() {
626626
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
627627

628628

629-
class Tab implements Comparable {
629+
static class Tab implements Comparable {
630630
int index;
631631
int left;
632632
int right;

app/src/processing/app/Language.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static public String getLanguage() {
221221
* Custom 'Control' class for consistent encoding.
222222
* http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle
223223
*/
224-
class UTF8Control extends ResourceBundle.Control {
224+
static class UTF8Control extends ResourceBundle.Control {
225225
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException,IOException {
226226
// The below is a copy of the default implementation.
227227
String bundleName = toBundleName(baseName, locale);

app/src/processing/app/PreferencesFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ public void run() {
832832
* most basic usage scenarios. Is there someone on the team I can contact?
833833
* Oracle, are you listening?
834834
*/
835-
class FontNamer extends JLabel implements ListCellRenderer<Font> {
835+
static class FontNamer extends JLabel implements ListCellRenderer<Font> {
836836
public Component getListCellRendererComponent(JList<? extends Font> list,
837837
Font value, int index,
838838
boolean isSelected,

app/src/processing/app/Recent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ int findRecord(String path) {
310310
// }
311311

312312

313-
class Record {
313+
static class Record {
314314
String path; // if not loaded, this is non-null
315315
// EditorState state; // if not loaded, this is non-null
316316

@@ -376,4 +376,4 @@ String getPath() {
376376
// return getPath().equals(r.getPath());
377377
// }
378378
}
379-
}
379+
}

core/src/processing/core/PGraphicsJava2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ protected void imageImpl(PImage who,
14501450
}
14511451

14521452

1453-
class ImageCache {
1453+
static class ImageCache {
14541454
boolean tinted;
14551455
int tintedColor;
14561456
int[] tintedTemp; // one row of tinted pixels

core/src/processing/core/PShapeSVG.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ public Gradient(PShapeSVG parent, XML properties) {
14311431
}
14321432

14331433

1434-
class LinearGradient extends Gradient {
1434+
static class LinearGradient extends Gradient {
14351435
float x1, y1, x2, y2;
14361436

14371437
public LinearGradient(PShapeSVG parent, XML properties) {
@@ -1461,7 +1461,7 @@ public LinearGradient(PShapeSVG parent, XML properties) {
14611461
}
14621462

14631463

1464-
class RadialGradient extends Gradient {
1464+
static class RadialGradient extends Gradient {
14651465
float cx, cy, r;
14661466

14671467
public RadialGradient(PShapeSVG parent, XML properties) {
@@ -1490,7 +1490,7 @@ public RadialGradient(PShapeSVG parent, XML properties) {
14901490

14911491

14921492

1493-
class LinearGradientPaint implements Paint {
1493+
static class LinearGradientPaint implements Paint {
14941494
float x1, y1, x2, y2;
14951495
float[] offset;
14961496
int[] color;
@@ -1615,7 +1615,7 @@ public Raster getRaster(int x, int y, int w, int h) {
16151615
}
16161616

16171617

1618-
class RadialGradientPaint implements Paint {
1618+
static class RadialGradientPaint implements Paint {
16191619
float cx, cy, radius;
16201620
float[] offset;
16211621
int[] color;
@@ -1773,7 +1773,7 @@ protected void styles(PGraphics g) {
17731773
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17741774

17751775

1776-
public class Font extends PShapeSVG {
1776+
public static class Font extends PShapeSVG {
17771777
public FontFace face;
17781778

17791779
public HashMap<String,FontGlyph> namedGlyphs;
@@ -1887,7 +1887,7 @@ public float textWidth(String str, float size) {
18871887
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18881888

18891889

1890-
class FontFace extends PShapeSVG {
1890+
static class FontFace extends PShapeSVG {
18911891
int horizOriginX; // dflt 0
18921892
int horizOriginY; // dflt 0
18931893
// int horizAdvX; // no dflt?
@@ -1924,7 +1924,7 @@ protected void drawShape() {
19241924
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19251925

19261926

1927-
public class FontGlyph extends PShapeSVG { // extends Path
1927+
public static class FontGlyph extends PShapeSVG { // extends Path
19281928
public String name;
19291929
char unicode;
19301930
int horizAdvX;

core/src/processing/opengl/FontTexture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,4 +390,4 @@ void updateTex() {
390390
crop[2] + 2, -crop[3] + 2);
391391
}
392392
}
393-
}
393+
}

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,7 @@ protected void flushPolys() {
25272527
}
25282528

25292529

2530-
class Triangle {
2530+
static class Triangle {
25312531
int i0, i1, i2;
25322532
PImage tex;
25332533
float dist;

0 commit comments

Comments
 (0)