* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_13;
+package org.altusmetrum.altoslib_14;
import java.io.*;
import java.util.*;
}
break;
case type_long:
- result.append(new Long(l_number).toString());
+ result.append(Long.valueOf(l_number).toString());
break;
case type_string:
quote(result, string);
* all inner classes are only members of their immediate outer
* class
*/
+ @SuppressWarnings("unchecked")
private Object make(Class c, Class enclosing_class, Object enclosing_object) {
Object ret;
if (c == Boolean.TYPE) {
Constructor<?> ctor = ((Class<?>)c).getDeclaredConstructor((Class<?>) enclosing_class);
object = ctor.newInstance(enclosing_object);
} else {
- object = c.newInstance();
+ object = c.getDeclaredConstructor().newInstance();
}
for (; c != Object.class; c = c.getSuperclass()) {
for (Field field : c.getDeclaredFields()) {
} else if (object instanceof String) {
type = type_string;
string = (String) object;
+ } else if (object == null) {
+ System.out.printf("unexpected null object\n");
+ } else if (object.getClass() == null) {
+ System.out.printf("unexpected null object class\n");
} else if (object.getClass().isArray()) {
assert_array(true);