Skip to content

5.0.0

Latest
Compare
Choose a tag to compare
@bbakerman bbakerman released this 13 May 02:00
cabda40

Compile time breaking of DataLoaderOptions

Back in version 4.0.0 we introduced immutability into the DataLoaderOptions class, which was a good thing.

However it left the old mutative set methods in place and made them immutable. This was a mistake. This leads to bugs at runtime

for example

DataLoaderOptions options = DataLoaderOptions.newOptions();
if (maxBatchSize != BatchLoader.UNSET_BATCH_SIZE) {
  options.setMaxBatchSize(maxBatchSize);
}
return options.setCacheMap(cache);

The above code would continue compile but the setMaxBatchSize would never take affected with the immutable support.

So to help address #190 version 5.0.0 has removed the set methods and require the Builder methods to be used to ensure that code that relied on the old mutative methods now break at compile time and not at runtime.

DataLoaders now can have names

A DataLoader can now have a name. Its nullable so that old code can still work but its preferred that DataLoaders are named. This will help in debugging and also in instrumentation.

If you register a DataLoader into a DataLoaderRegistry then the names must match otherwise it will be rejected at registration time.

A series of long standing deprecated DataLoaderFactory methods got removed here as well.

What's Changed

  • Remove jcenter reference after sunset by @dondonz in #184
  • add jmh testing with one initial performance test by @andimarek in #187
  • adds explicit jmh dependency for the idea jmh plugin by @andimarek in #192
  • OSGI - Make org.jspecify.* imports optional by @schulm in #194
  • Breaking change - adds a name to a DataLoader by @bbakerman in #193
  • Breaking change: using LongAdder instead of AtomicLong by @dfa1 in #186
  • Breaking change - renaming old mutable setXX methods by @bbakerman in #191

New Contributors

Full Changelog: v4.0.0...v5.0.0