- * If the underlying class is a inner (non-static nested) class, a new instance will be created using null
as the
- * this$0 synthetic reference. The instantiated object will work as long as it actually don't use any member variable or method
- * fron the enclosing instance. */
- abstract public T newInstance ();
-
- /** Constructor for inner classes (non-static nested classes).
- * @param enclosingInstance The instance of the enclosing type to which this inner instance is related to (assigned to its
- * synthetic this$0 field). */
- abstract public T newInstance (Object enclosingInstance);
-
- static public null
as the
+ * this$0 synthetic reference. The instantiated object will work as long as it actually don't use any member variable or method
+ * fron the enclosing instance.
+ */
+ @SuppressWarnings("unchecked")
+ public T newInstance() {
+ return (T) classAccessor.newInstance();
+ }
+
+ /**
+ * Constructor for inner classes (non-static nested classes).
+ *
+ * @param enclosingInstance The instance of the enclosing type to which this inner instance is related to (assigned to its
+ * synthetic this$0 field).
+ */
+ @SuppressWarnings("unchecked")
+ public T newInstance(Object enclosingInstance) {
+ return (T) classAccessor.newInstance(0, enclosingInstance);
+ }
+
+ static public