Skip to content

Commit 196dcfc

Browse files
committed
remove a bunch of compiler warnings
1 parent af61cd9 commit 196dcfc

File tree

14 files changed

+26
-29
lines changed

14 files changed

+26
-29
lines changed

java/src/processing/mode/java/AutoFormat.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,14 @@ private boolean lookup_com(final String keyword) {
426426
/**
427427
* Takes all whitespace off the end of its argument.
428428
*/
429-
private void trimRight(final StringBuilder sb) {
430-
while (sb.length() >= 1 && Character.isWhitespace(sb.charAt(sb.length() - 1)))
429+
static private void trimRight(final StringBuilder sb) {
430+
while (sb.length() >= 1 && Character.isWhitespace(sb.charAt(sb.length() - 1))) {
431431
sb.setLength(sb.length() - 1);
432+
}
432433
}
433434

434435

435-
/**
436-
* Entry point
437-
*/
436+
/** Entry point */
438437
public String format(final String source) {
439438
final String normalizedText = source.replaceAll("\r", "");
440439
final String cleanText =

java/src/processing/mode/java/DebugTray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public Object getValueFor(Object obj, int column) {
355355
}
356356

357357
@Override
358-
public Class getColumnClass(int column) {
358+
public Class<?> getColumnClass(int column) {
359359
if (column == 0) {
360360
return VariableNode.class;
361361
}

java/src/processing/mode/java/Debugger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,12 +1381,12 @@ protected void stopTrackingLineChanges() {
13811381
}
13821382

13831383

1384-
private void log(Level level, String msg) {
1384+
static private void log(Level level, String msg) {
13851385
Logger.getLogger(Debugger.class.getName()).log(level, msg);
13861386
}
13871387

13881388

1389-
private void log(Level level, String msg, Object obj) {
1389+
static private void log(Level level, String msg, Object obj) {
13901390
Logger.getLogger(Debugger.class.getName()).log(level, msg, obj);
13911391
}
13921392
}

java/src/processing/mode/java/JavaEditor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,7 @@ public void updateInterface(List<List<Handle>> handles,
25532553
}
25542554

25552555

2556-
private boolean[] getModifiedTabs(List<List<Handle>> handles) {
2556+
static private boolean[] getModifiedTabs(List<List<Handle>> handles) {
25572557
boolean[] modifiedTabs = new boolean[handles.size()];
25582558

25592559
for (int i = 0; i < handles.size(); i++) {
@@ -2785,13 +2785,13 @@ public boolean automateSketch(Sketch sketch, List<List<Handle>> handles) {
27852785
}
27862786

27872787

2788-
private String replaceString(String str, int start, int end, String put) {
2788+
static private String replaceString(String str, int start, int end, String put) {
27892789
return str.substring(0, start) + put + str.substring(end, str.length());
27902790
}
27912791

27922792

27932793
//private int howManyInts(ArrayList<Handle> handles[])
2794-
private int howManyInts(List<List<Handle>> handles) {
2794+
static private int howManyInts(List<List<Handle>> handles) {
27952795
int count = 0;
27962796
//for (int i=0; i<handles.length; i++) {
27972797
for (List<Handle> list : handles) {
@@ -2807,7 +2807,7 @@ private int howManyInts(List<List<Handle>> handles) {
28072807

28082808

28092809
//private int howManyFloats(ArrayList<Handle> handles[])
2810-
private int howManyFloats(List<List<Handle>> handles) {
2810+
static private int howManyFloats(List<List<Handle>> handles) {
28112811
int count = 0;
28122812
//for (int i=0; i<handles.length; i++) {
28132813
for (List<Handle> list : handles) {

java/src/processing/mode/java/JavaMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public void run() {
208208

209209

210210
// TODO Why is this necessary? Why isn't Sketch.isModified() used?
211-
private boolean isSketchModified(Sketch sketch) {
211+
static private boolean isSketchModified(Sketch sketch) {
212212
for (SketchCode sc : sketch.getCode()) {
213213
if (sc.isModified()) {
214214
return true;

java/src/processing/mode/java/debug/VariableNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public boolean isLeaf() {
234234
}
235235

236236
@Override
237-
public Enumeration children() {
237+
public Enumeration<MutableTreeNode> children() {
238238
return Collections.enumeration(children);
239239
}
240240

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ public ClassMember definedIn3rdPartyClass(ClassMember tehClass,String memberName
14491449
}
14501450
}
14511451

1452-
Class probableClass = null;
1452+
Class<?> probableClass = null;
14531453
if (tehClass.getClass_() != null) {
14541454
probableClass = tehClass.getClass_();
14551455
} else {

java/src/processing/mode/java/pdex/CompilationChecker.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ private void compileMeQuitely(ICompilationUnit unit, Map<String, String> compile
370370
.getDefault()));
371371
compiler.compile(new ICompilationUnit[] { unit });
372372

373-
List problems = requestor.getProblems();
373+
List<IProblem> problems = requestor.getProblems();
374374
prob = new IProblem[problems.size()];
375375
int count = 0;
376-
for (Iterator it = problems.iterator(); it.hasNext();) {
376+
for (Iterator<IProblem> it = problems.iterator(); it.hasNext();) {
377377
IProblem problem = (IProblem) it.next();
378378
prob[count++] = problem;
379379
}
@@ -479,7 +479,6 @@ public IProblem[] getErrors(String sourceName, String source) {
479479
}
480480

481481

482-
@SuppressWarnings("rawtypes")
483482
public IProblem[] getErrors(String sourceName, String source, Map<String, String> settings) {
484483
fileName = sourceName;
485484
sourceText = "package " + fileName + ";\n" + source;

java/src/processing/mode/java/pdex/CompletionPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected JButton createIncreaseButton(int orientation) {
183183
return createZeroButton();
184184
}
185185

186-
private JButton createZeroButton() {
186+
static private JButton createZeroButton() {
187187
JButton jbutton = new JButton();
188188
jbutton.setPreferredSize(new Dimension(0, 0));
189189
jbutton.setMinimumSize(new Dimension(0, 0));

java/src/processing/mode/java/pdex/ErrorCheckerService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,14 +967,13 @@ protected boolean ignorableImport(String packageName) {
967967
/**
968968
* Various option for JDT Compiler
969969
*/
970-
protected Map compilerSettings;
970+
protected Map<String, String> compilerSettings;
971971

972972
/**
973973
* Sets compiler options for JDT Compiler
974974
*/
975-
@SuppressWarnings("rawtypes")
976975
protected void prepareCompilerSetting() {
977-
compilerSettings = new HashMap();
976+
compilerSettings = new HashMap<String, String>();
978977

979978
compilerSettings.put(CompilerOptions.OPTION_LineNumberAttribute,
980979
CompilerOptions.GENERATE);

0 commit comments

Comments
 (0)