linkedin / linkedin/parseq

Add @CheckReturnValue to detect common mistake through static analysis

Open
#159 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
268
PR merge metrics
No merged PRs in 30d

Description

A common mistake among new to ParSeq is to treat Task as if it's creation caused is execution e.g.:
```
Task getRelevanceItemsTask = _relevanceBackendClient.get(keys)
.map(relevanceItems -> {
if (Sets.difference(userItems, relevanceItems).size() > 0) {
// Doesn’t actually execute since this is a Task but isn’t connected to parent task
_userItemsClient.update(userId, userItems.addAll(relevanceItems));
}
return _userItems;
});
```
Using jsr305 [@CheckReturnValue](https://static.javadoc.io/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/CheckReturnValue.html) on methods that return Task would allow detecting this mistake through static analysis.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating methods that return Task and checking the project's dependency and static-analysis configuration for JSR-305 support. Use the example in the issue as the target mistake; done means applicable Task-returning methods are annotated and static analysis flags discarded Tasks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.