-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add nullness annotations to public API part 2 #1160
feat: add nullness annotations to public API part 2 #1160
Conversation
b6981a4
to
f9bdf10
Compare
core/src/main/java/ai/timefold/solver/core/api/score/stream/ConstraintCollectors.java
Outdated
Show resolved
Hide resolved
@triceo I have a general question here on |
None of these methods will ever return |
Small sidenote since I stumbled upon it: |
@triceo As my next step is the |
Getters and setters in the config typically use the convention "null means user did not specify, pick default." Those should probably all be annotated as nullable. The withers, on the other hand, should be annotated as non-null. If you use a wither, you are deliberately specifying what you want; not specifying means not using the wither at all. |
Hi @triceo, just wanted to keep you updated on my progress here, since I didn't manage to complete the work here by tonight. Currently, I'm still working on the I hope this delay in schedule doesn't lead to too many inconveniences for you, I hope the time buffer until the release date on Nov 10th (iirc) is sufficient. |
Hey @greyhairredbear - thanks for letting me know! As long as we can still merge it this week, we should be good. |
@triceo I guess I'm through with the last commit, I'll comment and tag you on the open todos/questions I have tomorrow (probably before I start my workday). After completing that I suppose this should be good to merge |
...a/ai/timefold/solver/core/config/heuristic/selector/common/nearby/NearbySelectionConfig.java
Outdated
Show resolved
Hide resolved
...main/java/ai/timefold/solver/core/config/heuristic/selector/entity/EntitySelectorConfig.java
Outdated
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/MoveSelectorConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/monitoring/SolverMetric.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have hopefully answered all the comments.
Unfortunately, in at least one of the configs, the nullability doesn't follow the agreed pattern, and therefore I must request changes.
benchmark/src/main/java/ai/timefold/solver/benchmark/config/PlannerBenchmarkConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/monitoring/SolverMetric.java
Outdated
Show resolved
Hide resolved
...a/ai/timefold/solver/core/config/heuristic/selector/common/nearby/NearbySelectionConfig.java
Outdated
Show resolved
Hide resolved
...main/java/ai/timefold/solver/core/config/heuristic/selector/entity/EntitySelectorConfig.java
Outdated
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/MoveSelectorConfig.java
Outdated
Show resolved
Hide resolved
test/src/main/java/ai/timefold/solver/test/api/score/stream/MultiConstraintAssertion.java
Outdated
Show resolved
Hide resolved
test/src/main/java/ai/timefold/solver/test/api/score/stream/MultiConstraintVerification.java
Show resolved
Hide resolved
...c/main/java/ai/timefold/solver/core/config/heuristic/selector/value/ValueSelectorConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/SolverConfig.java
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/SolverConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
@triceo I fixed the wrongly annotated getters/setters in |
5651df7
to
8f97503
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answering more of the comments.
You found some very bizarre pieces of code that we have in there. Note to self: some of this could use refactoring.
...c/main/java/ai/timefold/solver/core/config/heuristic/selector/value/ValueSelectorConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/termination/TerminationConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/termination/TerminationConfig.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/solver/SolverConfig.java
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java
Outdated
Show resolved
Hide resolved
test/src/main/java/ai/timefold/solver/test/api/score/stream/MultiConstraintAssertion.java
Outdated
Show resolved
Hide resolved
test/src/main/java/ai/timefold/solver/test/api/score/stream/MultiConstraintAssertion.java
Show resolved
Hide resolved
test/src/main/java/ai/timefold/solver/test/api/score/stream/MultiConstraintVerification.java
Show resolved
Hide resolved
The Sonar warnings, some of them important, are not your concern - don't worry about them. Something for me to look into after. |
8f97503
to
354efae
Compare
core/src/main/java/ai/timefold/solver/core/config/solver/monitoring/SolverMetric.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @greyhairredbear, for this work!
The solver and its users will be all the better for it.
I'll merge when the CI machinery approves. (Sonar won't, but I'll take care of that later.)
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
As discussed, this is a continuation of #1009. Opening again as draft.
Open items