Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: Release 1.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Patch:Code and Test
Description
Take the following Java as an example:
public interface IFoo { String getBar(); } class FooImpl { String getBar() { return "bar"; } }
As presently implemented, (bean my-foo) tries to invoke the following:
(. #<Method public java.lang.String FooImpl.getBar> (invoke my-foo nil))
However, as FooImpl is not public, this fails:
java.lang.IllegalAccessException: Class clojure.core$bean$fn__1827$fn__1828 can not access a member of class FooImpl with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess (Reflection.java:65) java.lang.reflect.Method.invoke (Method.java:588) clojure.core$bean$fn__1827$fn__1828.invoke (core_proxy.clj:382) clojure.core$bean$v__1832.invoke (core_proxy.clj:388) clojure.core$bean$fn__1838$thisfn__1839$fn__1840.invoke (core_proxy.clj:406) clojure.lang.LazySeq.sval (LazySeq.java:42) clojure.lang.LazySeq.seq (LazySeq.java:60) clojure.lang.RT.seq (RT.java:473)
However, the same thing succeeds if we call #<Method public java.lang.String Foo.getBar> rather than #<Method public java.lang.String FooImpl.getBar>.
Attachments
Activity
Charles Duffy
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | clojure--bean-support-for-private-implementation-classes-v1.diff [ 11145 ] |
Charles Duffy
made changes -
| Attachment | clojure--bean-support-for-private-implementation-classes-v0.diff [ 11144 ] |
Charles Duffy
made changes -
| Attachment | clojure--bean-support-for-private-implementation-classes-v2.diff [ 11146 ] |
Charles Duffy
made changes -
| Attachment | clojure--bean-support-for-private-implementation-classes-v3.diff [ 11173 ] |
Charles Duffy
made changes -
| Attachment | clojure--bean-support-for-private-implementation-classes-v1.diff [ 11145 ] |
Charles Duffy
made changes -
| Attachment | clojure--bean-support-for-private-implementation-classes-v2.diff [ 11146 ] |
Fix inaccurate documentation string