[ https://issues.apache.org/jira/browse/HARMONY-3632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548649
]
Pavel Pervov commented on HARMONY-3632:
---------------------------------------
1) By J2SE specification Class is not reflection "member" (see here http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Member.html)
in terms of inheritance. So, accessing private inner class through _reflection_ may be treated
as a valid operation.
2) Class's constructor is declared public. So, no problems with the JLS.
3) Javac gives the error because of that JLS citation.
So, here we have a kind of ambiguity in reading the spec (or contradicting specs).
> [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.
|