-
Bug
-
Resolution: Fixed
-
P3
-
1.1beta2, 1.1.1, 1.1.2, 1.1.4
-
1.1.5
-
generic, x86, sparc
-
generic, solaris_2.5.1, windows_95
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2015723 | 1.2.0 | William Maddox | P3 | Resolved | Fixed | 1.2beta |
This code doesn't compile:
public class foo {
public static class bar {
private int i;
private void setI(int i) {
this.i = i;
}
}
static public void main(String args[]) {
bar b = new bar();
System.out.println(b.i);
// b.setI(42);
b.i = 42;
System.out.println(b.i);
}
}
It dies with foo.java:18: Invalid left hand side of assignment.
b.i = 42;
However, if I replace the "b.i = 42" with "b.setI(42)", it works.
I haven't tried against 1.2, but this bug might be there, too.
(Note to myself: When this gets fixed, take the gratituous private
mutator methods out of sunw.hotjava.misc.RequestProcessor.Request)
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.
public class foo {
public static class bar {
private int i;
private void setI(int i) {
this.i = i;
}
}
static public void main(String args[]) {
bar b = new bar();
System.out.println(b.i);
// b.setI(42);
b.i = 42;
System.out.println(b.i);
}
}
It dies with foo.java:18: Invalid left hand side of assignment.
b.i = 42;
However, if I replace the "b.i = 42" with "b.setI(42)", it works.
I haven't tried against 1.2, but this bug might be there, too.
(Note to myself: When this gets fixed, take the gratituous private
mutator methods out of sunw.hotjava.misc.RequestProcessor.Request)
john.bui@eng 1997-10-17
No specific test case available. Implicity tested, closed with exposure.
- backported by
-
JDK-2015723 Setting private data member of an inner class doesn't work
- Resolved
- duplicates
-
JDK-4053194 problems with accessing inner classes private fields
- Closed
- relates to
-
JDK-4037255 javac sometimes doesn't use accessors when inner classes access private fields
- Closed