J2K: replace overloads with optional parameters not only for constructors but for methods too

This commit is contained in:
Valentin Kipyatkov
2015-04-08 16:22:15 +03:00
parent ff4ff78307
commit f6e363abb8
23 changed files with 721 additions and 184 deletions
@@ -0,0 +1,44 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
class A {
@NotNull
Object foo(String s) {
System.out.println("s = " + s);
return "";
}
@NotNull
Object foo() {
return foo(null);
}
@Nullable
Object bar(String s) {
System.out.println("s = " + s);
return s == null ? "" : null;
}
@NotNull
Object bar() {
return bar(null);
}
public @Nullable Object bar1(String s) {
System.out.println("s = " + s);
return s == null ? "" : null;
}
public @NotNull Object bar1() {
return bar1(null);
}
@Deprecated
public void f() {
f(1);
}
public void f(int p) {
System.out.println("p = " + p);
}
}