Community
Participate
Working Groups
FYI, this has been asked for on the aether-users mailing list already [1], but I think it is better to keep track of here in Bugzilla. Currently, an ResolutionErrorPolicy supports the caching of two outcomes: CACHE_NOT_FOUND and CACHE_TRANSFER_ERROR. The latter also covers the case that a user defined TransferListener throws a TransferCancelledException. IMHO, there are valid use cases where a real transfer error (e.g., a checksum mismatch) should be cached, but the fact that the user cancelled the transfer should not be. This makes it possible to reattempt a transfer previously cancelled by the user, while still caching "technical" resolution errors like checksum mismatches. I hence propose adding CACHE_TRANSFER_CANCELLED (or CACHE_TRANSFER_CANCELLATION or ...). What do you think? [1] <https://dev.eclipse.org/mhonarc/lists/aether-users/msg00610.html>
FWIW, I do realize that this is difficult to do in a binary-compatible manner as int CACHE_ALL = CACHE_NOT_FOUND | CACHE_TRANSFER_ERROR; // 0x01 | 0x02 You cannot simply add another disjunct to CACHE_ALL, as older clients would then use (due to the way integer constants are inlined by javac) still use 0x03, which would exclude the newly introduced disjunct CACHE_TRANSFER_CANCELLED. That being said, I still think CACHE_TRANSFER_CANCELLED is valuable to have.