Bug 483847 - [null] Incorrect 'return type is incompatible' error (mismatching null constraints)
Summary: [null] Incorrect 'return type is incompatible' error (mismatching null constr...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2015-12-07 16:23 EST by Tom van den Berge CLA
Modified: 2023-05-16 09:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom van den Berge CLA 2015-12-07 16:23:27 EST
In some of my classes, I'm getting an error after a clean+build, but not after an incremental build:

@NonNullByDefault
public interface MyInterface {
  Set<String> get();
}

@NonNullByDefault
public class MyClass implements MyInterface {
  Set<String> get() { ... }
}

The return type of the method in MyClass produces the following error:

"The return type is incompatible with '@NonNull Set<String>' return from MyInterface.get() (mismatching null constraints)"

Similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=473818, this bug only appears after cleaning+rebuilding the project, and only for a few classes. It disappears when making a trivial change, and invoking the incremental compiler by saving it.

Just like with the mentioned bug, I'm not able to reproduce this problem in a separate project :(

The problems only seems to happen for parameterized return types. Also, if one implementation of an interface shows this problem, then all other implementations show it, too, at the same method.
Comment 1 Eclipse Genie CLA 2021-04-25 08:13:42 EDT
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.
Comment 2 Eclipse Genie CLA 2023-05-16 09:20:08 EDT
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.