You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java cleverly lets you call a method with an inaccessible argument type, by
simply passing null. For example, you may have:
package foo;
class Secret {
}
public class Foo {
public void foo (Secret s) { ... }
}
package bar;
public class Bar {
public void callFoo () {
new Foo().foo(null);
}
}
which is totally legal code. It is impossible for Bar to create an instance
of Secret, but it can pass null.
Now for the problem. We convert the foo() call into:
RT.invoke("foo", new Class<?>[]{ Secret.class }, new Foo())
which references Secret.class by name and thus does not compile. Sigh.
Original issue reported on code.google.com by [email protected] on 17 May 2010 at 2:42
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 17 May 2010 at 2:42The text was updated successfully, but these errors were encountered: