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

TypeError when attemping to create an instance of non-public class could be better

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b15
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        This issue was reported by Adrian Druzgalski ("amdruz") via twitter.

        File: Foo.java

        class Foo {
          public Foo() {}
        }

        $ javac Foo.java
        $ jjs -classpath .
        jjs> var Foo = Java.type("Foo")
        jjs> Foo
        [JavaClass Foo]
        jjs> var obj = new Foo();
        <shell>:1 TypeError: Can not construct Foo with the passed arguments; they do not match any of its constructor signatures.

        The error could say "Foo" is a non-public class and so an instance of that can't be created - rather than not being able to match a constructor.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                sundar Sundararajan Athijegannathan
                Reporter:
                sundar Sundararajan Athijegannathan
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: