blob: 190b82677d5ff51688dcf67b76922a1fbf54d8ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import org.aspectj.testing.Tester;
public class MethodsWithTheSameName {
public static void main(String[] args) {
Inner i = new Inner("inner");
i.f((String)null);
i.f("call1");
i.f(new Inner("call2"));
Tester.checkEqual(strings, "null:inner-null:null-inner:null:call2:");
}
static String strings = "";
static class Inner {
String s;
Inner(String s) { this.s = s; }
void f(String str) {
f(str == null ? null : new Inner("null-"+s));
f(str == null ? new Inner(s+"-null") : null);
}
void f(Inner i) { strings += i + ":"; }
public String toString() { return s; }
}
}
|