harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3632) [drlvm][kernel] Drlvm does not allow to call public constructor of 'private static' inner class from within another class
Date Wed, 05 Dec 2007 13:59:45 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548673

Alexey Varlamov commented on HARMONY-3632:

1) There is no inheritance issue, as we're considering access within a package to a private
nested class. Anyway specs for the reflection accessor methods such as Class.newInstance(),
Method.invoke() etc always operate with accessibility in terms of JLS. And I believe reflection
should behave consistently with normal access.
2) The quote is incomplete so may be confusing, sorry about that. Here is the missing part
(which precedes the first quote):
"A member (class, interface, field, or method) of a reference (class, interface, or array)
type or a constructor of a class type is accessible only if the type is accessible and the
member or constructor is declared to permit access:" 
3) javac enforces the rule right above, so everything is correct.

So I see no contradiction here.

> [drlvm][kernel] Drlvm does not allow to call public constructor of 'private static' inner
class from within another class
> -------------------------------------------------------------------------------------------------------------------------
>                 Key: HARMONY-3632
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3632
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, DRLVM, Non-bug differences from RI
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
> Here is the test that passes with SUN or BEA but fails with DRLVM
> import java.lang.reflect.*;
> public class Hello {
>     public static void main(String[] args) throws Exception {
>         Class cls = A.class.getDeclaredClasses()[0];
>         Constructor con = cls.getDeclaredConstructors()[0];
>         Object[] params = new Object[0];
>         con.newInstance(params);
>     }
> }
> class A {
>     private static class B {
>         B() {
>             System.out.println("PASSED");
>         }
>     }
> }
> This test prevents joda-time (see http://joda-time.sourceforge.net, JSR310)  tests to
be passed on DLRVM

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message