Minor formatting fixes on PR #33.

This commit is contained in:
Sam Pottinger
2019-11-25 14:53:36 -08:00
parent 2dd098eb4b
commit 01d508afce
2 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -36,4 +36,4 @@ public class TableTest {
Assert.assertEquals(people[0].name, "Person1");
Assert.assertEquals(people[0].age, 30);
}
}
}