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

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • core-libs
    • None
    • b15
    • generic
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: