Skip to content

4.x: Add SchedulerSupport annotation validator - #8292

Merged
akarnokd merged 1 commit into
ReactiveX:4.xfrom
akarnokd:4xSchedulerAnnotationCheck
Aug 20, 2026
Merged

4.x: Add SchedulerSupport annotation validator#8292
akarnokd merged 1 commit into
ReactiveX:4.xfrom
akarnokd:4xSchedulerAnnotationCheck

Conversation

@akarnokd

Copy link
Copy Markdown
Member

Add a validator test that checks if methods with TimeUnit parameter have the expected SchedulerSupport annotation.

Some methods had NONE because it uses the underlying scheduler for timestamps only. Now with this check, we made explicit what exact scheduler is involved regardless if the method runs code on it or not.

Rules:

  • If the TimeUnit is declared but no annotation -> report
  • If annotation is there but says NONE -> report
  • If the Scheduler is there but no annotation -> report
  • If annotation is there but is not CUSTOM -> report

Inspired by #8289


AI disclosure: the firstLine method was suggested by Grok 4.6 Super for the prompt how to get the method's line number out reflectively -> have to parse the class file and lookup in tables.

@github-actions

Copy link
Copy Markdown

🐷 TruffleHog + Entropy Beauty Scan

Average entropy of changed code: 4.59 bits/char
Verdict: ✅ Mid-4 beauty detected (thoughtful human code!)

Changed files entropy:

src/main/java/io/reactivex/rxjava4/core/Flowable.java: 4.787
src/main/java/io/reactivex/rxjava4/core/Observable.java: 4.764
src/main/java/io/reactivex/rxjava4/core/Streamable.java: 4.651
src/test/java/io/reactivex/rxjava4/validators/CheckSchedulerAnnotationsTest.java: 4.161

✅ No secrets or suspicious high-entropy strings found.

Mid-4 beauty heuristic in action — powered by our entropy chats! 😊

@akarnokd
akarnokd merged commit 68c432c into ReactiveX:4.x Aug 20, 2026
6 checks passed
@akarnokd
akarnokd deleted the 4xSchedulerAnnotationCheck branch August 20, 2026 08:37
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.58%. Comparing base (856bb48) to head (9ddbc20).
⚠️ Report is 1 commits behind head on 4.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                4.x    #8292      +/-   ##
============================================
- Coverage     98.61%   98.58%   -0.03%     
+ Complexity     7150     7149       -1     
============================================
  Files           824      824              
  Lines         50791    50791              
  Branches       6911     6911              
============================================
- Hits          50087    50074      -13     
- Misses          482      486       +4     
- Partials        222      231       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant