mirror of
https://github.com/processing/processing4.git
synced 2026-01-23 16:31:07 +01:00
Minor formatting fixes on PR #33.
This commit is contained in:
@@ -1038,7 +1038,7 @@ public class Table {
|
||||
// Class sketchClass = sketch.getClass();
|
||||
Class<?> sketchClass = enclosingObject.getClass();
|
||||
targetField = sketchClass.getDeclaredField(fieldName);
|
||||
// PApplet.println("found " + targetField);
|
||||
// PApplet.println("found " + targetField);
|
||||
Class<?> targetArray = targetField.getType();
|
||||
if (!targetArray.isArray()) {
|
||||
// fieldName is not an array
|
||||
@@ -1053,20 +1053,20 @@ public class Table {
|
||||
}
|
||||
|
||||
// Object enclosingObject = sketch;
|
||||
// PApplet.println("enclosing obj is " + enclosingObject);
|
||||
// PApplet.println("enclosing obj is " + enclosingObject);
|
||||
Class<?> enclosingClass = target.getEnclosingClass();
|
||||
Constructor<?> con = null;
|
||||
|
||||
try {
|
||||
if (enclosingClass == null) {
|
||||
con = target.getDeclaredConstructor(); //new Class[] { });
|
||||
// PApplet.println("no enclosing class");
|
||||
// PApplet.println("no enclosing class");
|
||||
} else {
|
||||
con = target.getDeclaredConstructor(new Class[] { enclosingClass });
|
||||
// PApplet.println("enclosed by " + enclosingClass.getName());
|
||||
// PApplet.println("enclosed by " + enclosingClass.getName());
|
||||
}
|
||||
if (!con.canAccess(null)) {
|
||||
// System.out.println("setting constructor to public");
|
||||
// System.out.println("setting constructor to public");
|
||||
con.setAccessible(true);
|
||||
}
|
||||
} catch (SecurityException e) {
|
||||
@@ -1082,7 +1082,7 @@ public class Table {
|
||||
if (getColumnIndex(name, false) != -1) {
|
||||
inuse.add(field);
|
||||
} else {
|
||||
// System.out.println("skipping field " + name);
|
||||
// System.out.println("skipping field " + name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1158,7 +1158,7 @@ public class Table {
|
||||
Array.set(outgoing, index++, item);
|
||||
}
|
||||
if (!targetField.canAccess(enclosingObject)) {
|
||||
// PApplet.println("setting target field to public");
|
||||
// PApplet.println("setting target field to public");
|
||||
targetField.setAccessible(true);
|
||||
}
|
||||
// Set the array in the sketch
|
||||
|
||||
@@ -36,4 +36,4 @@ public class TableTest {
|
||||
Assert.assertEquals(people[0].name, "Person1");
|
||||
Assert.assertEquals(people[0].age, 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user