Last change
on this file was 1272, checked in by wouter, 3 weeks ago |
#396 added test showing issue with super.equals() translation.
|
File size:
445 bytes
|
Line | |
---|
1 | package testcode;
|
---|
2 |
|
---|
3 | class AA {
|
---|
4 |
|
---|
5 | @Override
|
---|
6 | public boolean equals(Object obj) {
|
---|
7 | return obj.equals("1");
|
---|
8 | }
|
---|
9 |
|
---|
10 | }
|
---|
11 |
|
---|
12 | class B extends AA {
|
---|
13 |
|
---|
14 | @Override
|
---|
15 | public boolean equals(Object obj) {
|
---|
16 | return super.equals("1");
|
---|
17 | }
|
---|
18 |
|
---|
19 | }
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Checks around sub-classes
|
---|
23 | */
|
---|
24 | public class SubClass {
|
---|
25 |
|
---|
26 | static public void main(String[] args) {
|
---|
27 | System.out.println(new AA().equals("1") ? "okA" : "koA");
|
---|
28 | System.out.println(new B().equals("1") ? "okB" : "koB");
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.