Skip to content

Commit b59ad67

Browse files
committed
Add failing test to address #619
1 parent 1e1d196 commit b59ad67

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

java/test/processing/mode/java/ParserTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ public void annotations() {
318318
expectGood("annotations", true);
319319
}
320320

321+
@Test
322+
public void staticannotations() {
323+
expectGood("staticannotations", true);
324+
}
325+
321326
@Test
322327
public void generics() {
323328
expectGood("generics", true);
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import processing.core.*;
2+
import processing.data.*;
3+
import processing.event.*;
4+
import processing.opengl.*;
5+
6+
import java.util.HashMap;
7+
import java.util.ArrayList;
8+
import java.io.File;
9+
import java.io.BufferedReader;
10+
import java.io.PrintWriter;
11+
import java.io.InputStream;
12+
import java.io.OutputStream;
13+
import java.io.IOException;
14+
15+
public class staticannotations extends PApplet {
16+
17+
public void setup() {
18+
19+
class Button {
20+
21+
int x, y, radius;
22+
23+
public Button (int x, int y, int radius) {
24+
this.x = x;
25+
this.y = y;
26+
this.radius = radius;
27+
}
28+
29+
boolean over() {
30+
return dist(mouseX, mouseY, this.x, this.y) < this.radius;
31+
}
32+
33+
void draw() {
34+
ellipse(this.x, this.y, this.radius * 2, this.radius * 2);
35+
}
36+
37+
@Deprecated
38+
void old() {
39+
ellipse(this.x, this.y, this.radius, this.radius);
40+
}
41+
42+
}
43+
44+
45+
class ButtonOther extends Button {
46+
47+
@Override
48+
boolean over() {
49+
return dist(mouseX, mouseY, this.x, this.y) < this.radius / 2;
50+
}
51+
52+
}
53+
54+
noLoop();
55+
}
56+
57+
static public void main(String[] passedArgs) {
58+
String[] appletArgs = new String[] { "staticannotations" };
59+
if (passedArgs != null) {
60+
PApplet.main(concat(appletArgs, passedArgs));
61+
} else {
62+
PApplet.main(appletArgs);
63+
}
64+
}
65+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class Button {
2+
3+
int x, y, radius;
4+
5+
public Button (int x, int y, int radius) {
6+
this.x = x;
7+
this.y = y;
8+
this.radius = radius;
9+
}
10+
11+
boolean over() {
12+
return dist(mouseX, mouseY, this.x, this.y) < this.radius;
13+
}
14+
15+
void draw() {
16+
ellipse(this.x, this.y, this.radius * 2, this.radius * 2);
17+
}
18+
19+
@Deprecated
20+
void old() {
21+
ellipse(this.x, this.y, this.radius, this.radius);
22+
}
23+
24+
}
25+
26+
27+
class ButtonOther extends Button {
28+
29+
@Override
30+
boolean over() {
31+
return dist(mouseX, mouseY, this.x, this.y) < this.radius / 2;
32+
}
33+
34+
}

0 commit comments

Comments
 (0)