-
Notifications
You must be signed in to change notification settings - Fork 126
fix: refactor AbstractTimeLineChartProblemStatistic constructor to not throw null pointer exception when unmarshalled by JaxB #1551
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
Conversation
Hello @Magnusrk! Thank you for your contribution. As I'm sure you've noticed, the benchmarker (and specifically the aggregator) is the biggest accumulation of technical debt in our entire codebase. It has almost no test coverage, and that inevitably leads to regressions. (Which is not helped by the fact that the aggregator is only rarely used.) Your PR presents an opportunity to introduce some test coverage. Would you mind adding a test for serialization and deserialization of the benchmark result? The way I imagine it working is:
Is this something you'd be willing to do? If so, please use AssertJ for assertions, as that will save you quite a lot of time and will be consistent with the rest of the solver codebase. |
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.
Well done, @Magnusrk!
Will merge after the final review comment is resolved and the build is green.
benchmark/src/test/java/ai/timefold/solver/benchmark/util/TestSolution.java
Outdated
Show resolved
Hide resolved
|
Merged. Thank you again for your contribution, @Magnusrk! |
When using the BenchmarkAggregatorFrame to unmarshall PlannerBenchmarkResult.xml with the problemStatisticType SCORE_CALCULATION_SPEED or MOVE_EVALUATION_SPEED the would result in null pointer exception due to empty JaxB noargs constructors calling the parameterized constructor with null as the PlannerBenchmarkResult.
Stacktrace