| Summary: | Deprecate and remove IDisposable | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Oleg Besedin <ob1.eclipse> | ||||||
| Component: | E4 | Assignee: | Project Inbox <e4.runtime-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | ob1.eclipse | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Oleg Besedin
Created attachment 182217 [details]
Patch - removes uses of IDisposable from SDK and deprecates it
One other issue with having IDisposable: IEclipseContext inherits from IDisposable which comes from the DI bundle. So, even if DI is not used directly, the bundle needs to be included in the dependencies and the error message is a bit cryptic.
The attached patch removes uses of IDisposable from SDK and deprecates it.
Most uses are trivial typecasts that no longer needed; they were in a need of cleanup regardless of this change:
((IDisposable) context).dispose();
and
if (appContext instanceof IDisposable) {
((IDisposable) appContext).dispose();
}
weren't needed.
A few non-trivial uses of IDisposable are replaced with "@PreDestroy". I also added #dispose() to the ILookupStrategy. (Note that ILookupStrategy itself is internal and likely be removed.)
Added #dispose() method to IEclipseContext.
Patch applied to CVS Head.
I am keeping the bug open to remove now-deprecated IDisposable by the end of 4.1M4.
If your code uses IDisposable:
- The IEclipseContext includes {@link #dispose()} method in its definition, not type conversion or checking is needed; and
- For injected objects, consider using the "PreDestroy" annotation instead.
Created attachment 183038 [details]
Removes IDisposable
The patch removes previosuly deprecated IDisposable and RunAndTrack#disposed().
Patch applied to CVS Head. |