Bug 485391 - Add ResolutionErrorPolicy.CACHE_TRANSFER_CANCELLED distinct from CACHE_TRANSFER_ERROR
Summary: Add ResolutionErrorPolicy.CACHE_TRANSFER_CANCELLED distinct from CACHE_TRANSF...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Aether (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 483461
  Show dependency tree
 
Reported: 2016-01-08 04:09 EST by Andreas Sewe CLA
Modified: 2017-02-23 14:08 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sewe CLA 2016-01-08 04:09:15 EST
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>
Comment 1 Andreas Sewe CLA 2016-01-08 04:13:05 EST
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.