4.3.1: Avoid use of newInstance when it is terminally deprecated

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 17
    • Component/s: specification

      Example 4.3.1-1 uses reflection, specifically Class::newInstance, to demonstrate object creation:

      (Point)Class.forName("Point").newInstance();

      Reflection is too sophisticated to show so early in the JLS, and in any case newInstance has been ordinarily deprecated since 9. When newInstance is terminally deprecated, the example should replace reflection with a simple `new Point()` clause. The mention of newInstance in 11.2.3 should be clarified at the same time to refer to Constructor::newInstance.

            Assignee:
            Alex Buckley
            Reporter:
            Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: