Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326090 - [api] ProfileChangeOperation leaks non-API
Summary: [api] ProfileChangeOperation leaks non-API
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.7 M3   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 309539
  Show dependency tree
 
Reported: 2010-09-23 14:59 EDT by DJ Houghton CLA
Modified: 2010-09-23 16:30 EDT (History)
1 user (show)

See Also:
tjwatson: pmc_approved+


Attachments
patch (3.50 KB, patch)
2010-09-23 16:15 EDT, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2010-09-23 14:59:05 EDT
ProfileChangeOperation#getProfileChangeRequest returns the implementing class rather than the interface (IProfileChangeRequest). We need to change this if we intend to make the class internal as per bug 309539.
Comment 1 DJ Houghton CLA 2010-09-23 16:01:41 EDT
John and I talked about this and this is the scenario:
- we have new API in 3.6: ProfileChangeOperation
- it has a method (#getProfileChangeRequest) which returned a ProfileChangeRequest object
- in 3.6 PCR is internal provisional and marked as @noreference
- so if clients were calling the method, then it would have been an illegal reference.
- there are no references to this method in the SDK. (only in the p2 tests)

We agree the best course of action is to change the method to return the API class (IProfileChangeRequest) and add an entry in the migration guide saying that we are fixing an API leak.

Adding Tom to the CC for PMC approval and comment.
Comment 2 DJ Houghton CLA 2010-09-23 16:15:58 EDT
Created attachment 179484 [details]
patch
Comment 3 Thomas Watson CLA 2010-09-23 16:24:25 EDT
+1

If someone was calling getProfileChangeRequest in 3.6, I assume it was valid to assign the value to IProfileChangeRequest?  This way the client code would not have been referencing the internal type.  If so, we should point out in the migration guide that any client code calling this method must be recompiled, even if they were not referencing the internal type. otherwise they will get a no method def found error because of the change in return type.
Comment 4 DJ Houghton CLA 2010-09-23 16:30:55 EDT
Yep, you are correct. Clients could have called the method and assigned the result to the API class. I have created bug 326100 to address entering this change into the migration guide for 3.7.

Patch released to HEAD.

Closing.