remove a handful of warnings

This commit is contained in:
Ben Fry
2014-02-06 23:31:58 -05:00
parent 9803d7958a
commit 434d8138cc
5 changed files with 21 additions and 9 deletions

View File

@@ -2364,7 +2364,7 @@ public class PGraphicsJava2D extends PGraphics {
if (primarySurface) {
// 'offscreen' will probably be removed in the next release
if (useOffscreen) {
raster = ((BufferedImage) offscreen).getRaster();
raster = offscreen.getRaster();
} else if (image instanceof VolatileImage) {
// when possible, we'll try VolatileImage
raster = ((VolatileImage) image).getSnapshot().getRaster();

View File

@@ -1644,10 +1644,10 @@ public class JSONObject {
return value.toString();
}
if (value instanceof Map) {
return new JSONObject((Map)value).toString();
return new JSONObject(value).toString();
}
if (value instanceof Collection) {
return new JSONArray((Collection)value).toString();
return new JSONArray(value).toString();
}
if (value.getClass().isArray()) {
return new JSONArray(value).toString();
@@ -1683,13 +1683,13 @@ public class JSONObject {
}
if (object instanceof Collection) {
return new JSONArray((Collection)object);
return new JSONArray(object);
}
if (object.getClass().isArray()) {
return new JSONArray(object);
}
if (object instanceof Map) {
return new JSONObject((Map)object);
return new JSONObject(object);
}
Package objectPackage = object.getClass().getPackage();
String objectPackageName = objectPackage != null
@@ -1732,9 +1732,9 @@ public class JSONObject {
} else if (value instanceof JSONArray) {
((JSONArray) value).write(writer, indentFactor, indent);
} else if (value instanceof Map) {
new JSONObject((Map) value).write(writer, indentFactor, indent);
new JSONObject(value).write(writer, indentFactor, indent);
} else if (value instanceof Collection) {
new JSONArray((Collection) value).write(writer, indentFactor,
new JSONArray(value).write(writer, indentFactor,
indent);
} else if (value.getClass().isArray()) {
new JSONArray(value).write(writer, indentFactor, indent);

View File

@@ -961,7 +961,7 @@ public class PJOGL extends PGL {
InputEvent.ALT_MASK);
char keyChar;
if ((int)nativeEvent.getKeyChar() == 0) {
if (nativeEvent.getKeyChar() == 0) {
keyChar = PConstants.CODED;
} else {
keyChar = nativeEvent.getKeyChar();