-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for the JCache 1.1 preview, except for 1.0 TCK breaking changes
A preview of JCache 1.1 has been made available for review until 11/18. This update includes JavaDoc fixes, spec corrections, additional tests, and fixes incorrect tests. The 1.1 TCK is not compatible with 1.0's TCK. Some tests assert the opposite behavior, such as relaxing types to not throw exceptions or changing the statistics of putIfAbsent. Since 1.1 is in preview, we maintain 1.0 compatibility with the acceptable fixes uncovered by the later TCK. In particular the specification requires that a loader, writer, expiry, and listeners are closed if they implement Closable. This was in the JavaDoc but not the TCK, making it easy to overlook. https://jcp.org/aboutJava/communityprocess/maintenance/jsr107/107MR1-summary.html
- Loading branch information
Showing
5 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,11 +47,6 @@ | |
* @author [email protected] (Ben Manes) | ||
*/ | ||
final class CacheFactory { | ||
// Avoid asynchronous executions due to the TCK's poor test practices | ||
// https://github.com/jsr107/jsr107tck/issues/78 | ||
static final boolean USE_DIRECT_EXECUTOR = | ||
System.getProperties().containsKey("org.jsr107.tck.management.agentId"); | ||
|
||
final Config rootConfig; | ||
final CacheManager cacheManager; | ||
|
||
|
@@ -143,8 +138,8 @@ private final class Builder<K, V> { | |
this.caffeine = Caffeine.newBuilder(); | ||
this.statistics = new JCacheStatisticsMXBean(); | ||
this.ticker = config.getTickerFactory().create(); | ||
this.executor = config.getExecutorFactory().create(); | ||
this.expiryPolicy = config.getExpiryPolicyFactory().create(); | ||
this.executor = USE_DIRECT_EXECUTOR ? Runnable::run : config.getExecutorFactory().create(); | ||
this.dispatcher = new EventDispatcher<>(executor); | ||
|
||
caffeine.executor(executor); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
* | ||
* @author [email protected] (Ben Manes) | ||
*/ | ||
final class Registration<K, V> { | ||
public final class Registration<K, V> { | ||
private final CacheEntryListenerConfiguration<K, V> configuration; | ||
private final EventTypeAwareListener<K, V> listener; | ||
private final CacheEntryEventFilter<K, V> filter; | ||
|