Issue1331437
Created on 2005-10-19.11:13:09 by strandpyper, last changed 2006-08-18.02:29:10 by cgroves.
| Messages | |||
|---|---|---|---|
| msg1052 (view) | Author: Anand (strandpyper) | Date: 2005-10-19.11:13:09 | |
Consider the the following 3 java classes.
// ---- A.java ----
package x;
// package private class
class A {
public void f() {
System.out.println("f");
}
}
// ---- B.java ----
package x;
// public class extending from a package private class
public class B extends A {
public void g() {
System.out.println("g");
}
}
// ---- C.java ----
import x.*;
public class C {
public static void main(String[] args) {
B.g();
B.f();
}
}
The class C compiles without errors and runs without any
problems. But it does not work in jython.
>>> from x import B
>>> dir(B)
['g']
>>> b = B()
>>> b.g()
g
>>> b.f()
Traceback (innermost last):
File "<console>", line 1, in ?
AttributeError: 'javainstance' object has no attribute 'f'
# but there are available in java.
>>> for m in B.getMethods(): print m.getName()
g
f
hashCode
getClass
wait
wait
wait
equals
notify
notifyAll
toString
|
|||
| msg1053 (view) | Author: Anand (strandpyper) | Date: 2005-10-25.05:24:26 | |
Logged In: YES
user_id=1343692
There was a mistake in the code of class C in the above example.
This is the correct version..
// ---- C.java ----
import x.*;
public class C {
public static void main(String[] args) {
B b = new B();
b.g();
b.f();
}
}
|
|||
| msg1054 (view) | Author: Anand (strandpyper) | Date: 2005-10-25.05:28:13 | |
Logged In: YES user_id=1343692 This is a known bug in java. Here is the bug page.. http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4533479 |
|||
| msg1055 (view) | Author: Charlie Groves (cgroves) | Date: 2006-08-18.02:29:10 | |
Logged In: YES user_id=1174327 Duplicate of 222874 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2005-10-19 11:13:09 | strandpyper | create | |
Supported by Python Software Foundation,
Powered by Roundup