Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313585

Summary: FileReader should check for ECF UserCancelledException and throw an IOException with cause OperationCancelledException
Product: [Eclipse Project] Equinox Reporter: David Green <greensopinion>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthew, pascal
Version: unspecifiedFlags: pascal: review+
Target Milestone: 3.6 RC2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 312005    
Attachments:
Description Flags
patch to wrap UserCancelledException in an OperationCancelledException pascal: iplog+

Description David Green CLA 2010-05-19 13:28:26 EDT
org.eclipse.equinox.internal.p2.repository.FileReader provides an InputStream via this method:
org.eclipse.equinox.internal.p2.repository.FileReader.read(...).new InputStream() {...}.checkException()

checkException() should look at the cause and handle UserCancelledException, wrapping it in an OperationCancelledException.  Patch attached.
Comment 1 David Green CLA 2010-05-19 13:29:06 EDT
Created attachment 169158 [details]
patch to wrap UserCancelledException in an OperationCancelledException
Comment 2 Matthew Piggott CLA 2010-05-19 17:26:50 EDT
I've applied the patch, ran the test suite and looked at the callers and I don't see any problems with the changes.
Comment 3 Pascal Rapicault CLA 2010-05-19 17:44:31 EDT
I've reviewed the patch and committed it.
Comment 4 David Green CLA 2010-05-19 21:15:51 EDT
Wow, thanks for the super-fast fix!