Skip to content

Commit 2fc803b

Browse files
committed
Merge branch 'master' of github.com:processing/processing
2 parents 22a1024 + eb4e558 commit 2fc803b

File tree

5 files changed

+51
-35
lines changed

5 files changed

+51
-35
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Processing
22
==========
33

44
This is the official source code for the [Processing](http://processing.org) Development Environment (PDE),
5-
the “core” and the libraries that are included with the [download](http://processing.org/download).
5+
the “core” and the libraries that are included with the [download](http://processing.org/download).
66

77
__I've found a bug!__
88
Let us know [here](https://github.com/processing/processing/issues) (after first checking if someone has already posted a similar problem).
@@ -22,7 +22,7 @@ The instructions for building the source [are here](https://github.com/processin
2222
Please help us fix problems, and if you're submitting code, following the [style guidelines](https://github.com/processing/processing/wiki/Style-Guidelines) helps save us a lot of time.
2323

2424
__And finally...__
25-
Someday we'll also fix all these bugs, throw together hundreds of unit tests, and get rich off all this stuff that we're giving away for free. But not today.
25+
Someday we'll also fix all these bugs, throw together hundreds of unit tests, and get rich off all this stuff that we're giving away for free. But not today.
2626

2727
So in the meantime, I ask for your patience,
2828
[participation](https://github.com/processing/processing/wiki/Project-List),

build/windows/config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<opt>-Djna.nounpack=true</opt>
4444
<!-- starting in 3.0, require Java 8 -->
4545
<minVersion>1.8.0_51</minVersion>
46+
<!-- TODO: remove the line below as soon as we are on 1.8.0_60 or newer,
47+
see https://bugs.openjdk.java.net/browse/JDK-8060036 and
48+
http://kingsfleet.blogspot.com.br/2014/11/but-thats-impossible-or-finding-out.html -->
49+
<opt>-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot</opt>
4650
<!-- increase available per PDE X request -->
4751
<maxHeapSize>256</maxHeapSize>
4852
</jre>

core/src/processing/core/PApplet.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10234,6 +10234,13 @@ static public void runSketch(final String[] args,
1023410234
// }
1023510235
sketch.sketchPath = folder;
1023610236

10237+
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
10238+
if (args.length != argIndex + 1) {
10239+
// pass everything after the class name in as args to the sketch itself
10240+
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
10241+
sketch.args = PApplet.subset(args, argIndex + 1);
10242+
}
10243+
1023710244
// Call the settings() method which will give us our size() call
1023810245
// try {
1023910246
sketch.handleSettings();
@@ -10255,13 +10262,6 @@ static public void runSketch(final String[] args,
1025510262
// //fullScreen |= sketch.sketchFullScreen();
1025610263
// sketch.fullScreen |= fullScreen;
1025710264

10258-
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
10259-
if (args.length != argIndex + 1) {
10260-
// pass everything after the class name in as args to the sketch itself
10261-
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
10262-
sketch.args = PApplet.subset(args, argIndex + 1);
10263-
}
10264-
1026510265
sketch.external = external;
1026610266

1026710267
if (windowColor != 0) {

java/src/processing/mode/java/pdex/ASTGenerator.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,9 +1015,10 @@ protected static DefaultListModel<CompletionCandidate> filterPredictions(List<Co
10151015
if (candidates.get(0).getElementName()
10161016
.equals(candidates.get(candidates.size() - 1).getElementName())) {
10171017
log("All CC are methods only: " + candidates.get(0).getElementName());
1018-
for (CompletionCandidate candidate : candidates) {
1019-
candidate.regenerateCompletionString();
1020-
defListModel.addElement(candidate);
1018+
for (int i = 0; i < candidates.size(); i++) {
1019+
CompletionCandidate cc = candidates.get(i).withRegeneratedCompString();
1020+
candidates.set(i, cc);
1021+
defListModel.addElement(cc);
10211022
}
10221023
}
10231024
else {
@@ -1030,14 +1031,15 @@ protected static DefaultListModel<CompletionCandidate> filterPredictions(List<Co
10301031
CompletionCandidate cc = candidates.get(i - 1);
10311032
String label = cc.getLabel();
10321033
int x = label.lastIndexOf(')');
1033-
if(candidates.get(i).getType() == CompletionCandidate.PREDEF_METHOD) {
1034-
cc.setLabel((cc.getLabel().contains("<html>") ? "<html>" : "")
1035-
+ cc.getElementName() + "(...)" + label.substring(x + 1));
1036-
}
1037-
else {
1038-
cc.setLabel(cc.getElementName() + "(...)" + label.substring(x + 1));
1034+
String newLabel;
1035+
if (candidates.get(i).getType() == CompletionCandidate.PREDEF_METHOD) {
1036+
newLabel = (cc.getLabel().contains("<html>") ? "<html>" : "")
1037+
+ cc.getElementName() + "(...)" + label.substring(x + 1);
1038+
} else {
1039+
newLabel = cc.getElementName() + "(...)" + label.substring(x + 1);
10391040
}
1040-
cc.setCompletionString(cc.getElementName() + "(");
1041+
String newCompString = cc.getElementName() + "(";
1042+
candidates.set(i - 1, cc.withLabelAndCompString(newLabel, newCompString));
10411043
ignoredSome = true;
10421044
continue;
10431045
}

java/src/processing/mode/java/pdex/CompletionCandidate.java

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333

3434

3535
public class CompletionCandidate implements Comparable<CompletionCandidate>{
36-
private String elementName;
37-
private String label; // the toString value
38-
private String completionString;
39-
private Object wrappedObject;
40-
private int type;
36+
private final String elementName;
37+
private final String label; // the toString value
38+
private final String completionString;
39+
private final Object wrappedObject;
40+
private final int type;
4141

4242
static final int PREDEF_CLASS = 0;
4343
static final int PREDEF_FIELD = 1;
@@ -158,13 +158,25 @@ public CompletionCandidate(String name, String labelStr, String completionStr, i
158158
label = labelStr;
159159
completionString = completionStr;
160160
this.type = type;
161+
wrappedObject = null;
161162
}
162163

163164
public CompletionCandidate(String name, int type) {
164165
elementName = name;
165166
label = name;
166167
completionString = name;
167168
this.type = type;
169+
wrappedObject = null;
170+
}
171+
172+
private CompletionCandidate(String elementName, String label,
173+
String completionString, int type,
174+
Object wrappedObject) {
175+
this.elementName = elementName;
176+
this.label = label;
177+
this.completionString = completionString;
178+
this.type = type;
179+
this.wrappedObject = wrappedObject;
168180
}
169181

170182
public String getElementName() {
@@ -204,22 +216,21 @@ public String getNoHtmlLabel(){
204216
}
205217
}
206218

207-
public void setLabel(String label) {
208-
this.label = label;
209-
}
210-
211-
public void setCompletionString(String completionString) {
212-
this.completionString = completionString;
219+
public CompletionCandidate withLabelAndCompString(String label,
220+
String completionString) {
221+
return new CompletionCandidate(this.elementName, label, completionString,
222+
this.type, this.wrappedObject);
213223
}
214224

225+
@Override
215226
public int compareTo(CompletionCandidate cc) {
216227
if(type != cc.getType()){
217228
return cc.getType() - type;
218229
}
219230
return (elementName.compareTo(cc.getElementName()));
220231
}
221232

222-
public void regenerateCompletionString(){
233+
public CompletionCandidate withRegeneratedCompString() {
223234
if (wrappedObject instanceof MethodDeclaration) {
224235
MethodDeclaration method = (MethodDeclaration)wrappedObject;
225236

@@ -243,8 +254,7 @@ public void regenerateCompletionString(){
243254
if (method.getReturnType2() != null)
244255
label.append(" : " + method.getReturnType2());
245256
cstr.append(")");
246-
this.label = label.toString();
247-
this.completionString = cstr.toString();
257+
return this.withLabelAndCompString(label.toString(), cstr.toString());
248258
}
249259
else if (wrappedObject instanceof Method) {
250260
Method method = (Method)wrappedObject;
@@ -265,8 +275,7 @@ else if (wrappedObject instanceof Method) {
265275
label.append(" : " + method.getReturnType().getSimpleName());
266276
label.append(" - <font color=#777777>" + method.getDeclaringClass().getSimpleName() + "</font></html>");
267277
cstr.append(")");
268-
this.label = label.toString();
269-
this.completionString = cstr.toString();
278+
return this.withLabelAndCompString(label.toString(), cstr.toString());
270279
/*
271280
* StringBuilder label = new StringBuilder("<html>"+method.getName() + "(");
272281
StringBuilder cstr = new StringBuilder(method.getName() + "(");
@@ -286,6 +295,7 @@ else if (wrappedObject instanceof Method) {
286295
label.append(" - <font color=#777777>" + method.getDeclaringClass().getSimpleName() + "</font></html>");
287296
* */
288297
}
298+
return this;
289299
}
290300

291301
}

0 commit comments

Comments
 (0)