Consider these 2 interfaces:
- PackagePrivateInterface.java
package test;
interface PackagePrivateInterface {
public void myPublicMethod();
}
- PublicTagInterface.java
package test;
public interface PublicTagInterface extends PackagePrivateInterface {
}
And these 2 classes:
- Factory.java
package test;
public class Factory {
public static PublicTagInterface newImpl() {
return new PackagePrivateClass();
}
}
- PackagePrivateClass.java
package test;
class PackagePrivateClass implements PublicTagInterface {
PackagePrivateClass(){
}
public void myPublicMethod() {
}
}
Now examine the following snippet of clojure code:
(import '(test Factory PublicTagInterface))
(def foo (. Factory newImpl))
(. foo myPublicMethod)
java.lang.IllegalAccessException: Class clojure.lang.Reflector can not
access a member of class test.PackagePrivateInterface with modifiers
"public abstract" (NO_SOURCE_FILE:0)
Also "can not" should be spelled "cannot."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---