Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6338812

(reflect) Class.newInstance() failure for missing nullary constructor needs better detail string

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 5.0
    • core-libs
    • Fix Understood
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      When creating a new instance from the Class.newInstance() method, I used a class I had made which didn't have a "nullary" constructor.

      At the time I didn't know this would throw an error because I didn't know what a nullary constructor was (I *think* I know what it is - a constructor without any arguments?)

      I wasted a fair bit of time looking for other problems.



      JUSTIFICATION :
      It would have saved a lot of time if the error message was better.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The error message should say: "class being instantiated must have a no-argument constructor" or something to that effect.

            Unassigned Unassigned
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: