Files
openide/java/java-tests/testData/codeInsight/overrideImplement/afterTransformJBAnnotations.java
Tagir Valeev 5bd02b55c3 [java-intentions] AddVariableInitializerFix: suggest more suitable initial values instead of null for some types
Fixes IDEA-344453 Intellij should not try to initialize an Optional var with null

GitOrigin-RevId: 8097988bf1335a282138e8d09e350c3a5f65204d
2024-02-02 19:17:55 +00:00

62 lines
973 B
Java

package p;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
class M implements Map {
public int size() {
return 0;
}
public boolean isEmpty() {
return false;
}
public boolean containsKey(Object o) {
return false;
}
public boolean containsValue(Object o) {
return false;
}
public Object get(Object o) {
return null;
}
@N
public Object put(Object o, Object o2) {
return null;
}
public Object remove(Object o) {
return null;
}
public void putAll(@NN Map map) {
}
public void clear() {
}
@NN
public Set keySet() {
return Collections.emptySet();
}
@NN
public Collection values() {
return Collections.emptyList();
}
@NN
public Set<Entry> entrySet() {
return Collections.emptySet();
}
}
@interface N {}
@interface NN {}