Community
Participate
Working Groups
This is a subset of bug 427423: With compiler configured for null type annotations, and this code: //--- package m7test; import java.util.Set; import java.util.function.*; import java.util.stream.*; import org.eclipse.jdt.annotation.NonNull; public class StreamTest2 { void test(Stream<@NonNull String> s) { s.collect(new Collector<@NonNull String, Object, Integer>() { @Override public Supplier<Object> supplier() { return null; } @Override public BiConsumer<Object, String> accumulator() { return null; } @Override public BinaryOperator<Object> combiner() { return null; } @Override public Function<Object, Integer> finisher() { return null; } @Override public Set<java.util.stream.Collector.Characteristics> characteristics() { return null; } }); } } //--- compiler correctly complains against the return type of accumulator(): The return type is incompatible with 'BiConsumer<Object,@NonNull String>' returned from Collector<String,Object,Integer>.accumulator() (mismatching null constraints) The offered quick fix ("Change return type of accumulator(..) to '@NonNull'"), however, is wrong, producing public @NonNull BiConsumer<Object, String> accumulator() instead of public BiConsumer<Object, @NonNull String> accumulator() While bug 427423 is about more sophisticated quick fixes, that RFE isn't going to make it for Mars. I should, however, try to suppress the quick fix when it is about to propose junk.
Tentatively putting on my list.
Ran out of time for 4.7. Bulk move to 4.8.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.