typetools / typetools/checker-framework
Covariant annotations for Java 8 stream classes
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
I was trying to create a test case for someting similar to https://github.com/typetools/checker-framework/issues/886 when I got this:
A.java:10: warning: [argument.type.incompatible] incompatible types in argument.
return t(sb, false);
^
found : @Initialized @NonNull Supplier<@Initialized @NonNull Boolean>
required: @Initialized @NonNull Supplier<@Initialized @Nullable Boolean>
Is this normal?
import java.util.function.Supplier;
import org.checkerframework.checker.nullness.qual.Nullable;
public class A {
public boolean b(Supplier<Boolean> sb) {
return t(sb, false);
}
public <T> T t(Supplier<@Nullable T> st, T ifNull) {
T get = st.get();
return get != null ? get : ifNull;
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the supplied A.java reproduction with the Checker Framework and inspect how Java 8 Supplier and stream-related annotations are declared. Determine the intended treatment of the Supplier argument and use the existing annotation tests, if located, to verify the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100