Java classes with non-visible constructors should not be constructible
----------------------------------------------------------------------

                 Key: JRUBY-3102
                 URL: http://jira.codehaus.org/browse/JRUBY-3102
             Project: JRuby
          Issue Type: Bug
            Reporter: Charles Oliver Nutter
            Assignee: Thomas E Enebo
             Fix For: JRuby 1.1.5


An issue was brought up on IRC where a method with a private constructor 
appeared to successfully construct. What actually happened was that the 
superclass's __jcreate method was invoked during the initialization process. So 
ultimately we ended up with a Ruby wrapper object that claimed it was the type 
in question, but it wrapped an instance of the base class (in this case 
java.lang.Object).

The correct behavior is that classes with private or package-visible 
constructors should fail to construct, and as with other protected methods, 
protected constructor classes should be accessible (since we can't currently 
distinguish between in-hierarchy callers and extra-hierarchy callers).

I've made the changes locally, and will commit after filing the bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to