Files
openide/java/java-tests/testData/codeInsight/overrideImplement/afterDoNotTransformJBAnnotationsWhenNewNonAvailable.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
1.0 KiB
Java

package p;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
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;
}
@Nullable
public Object put(Object o, Object o2) {
return null;
}
public Object remove(Object o) {
return null;
}
public void putAll(@NotNull Map map) {
}
public void clear() {
}
@NotNull
public Set keySet() {
return Collections.emptySet();
}
@NotNull
public Collection values() {
return Collections.emptyList();
}
@NotNull
public Set<Entry> entrySet() {
return Collections.emptySet();
}
}