| Summary: | Can CompositeSourceContainer.fContainers have protected access instead of private | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dobrin Alexiev <dalexiev> |
| Component: | Debug | Assignee: | Platform-Debug-Inbox <platform-debug-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | pawel.1.piech |
| Version: | 4.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Dobrin Alexiev
The class has been designed to be create once and not change afterward, so I'd be reluctant to change that assumption since there is a lot of multi-threaded access done for source lookup. Although obviously the containers member initialization is not synchronized properly. Could you just write your own to sub-class with proper synchronization? (In reply to comment #1) > The class has been designed to be create once and not change afterward, so I'd > be reluctant to change that assumption since there is a lot of multi-threaded > access done for source lookup. Although obviously the containers member > initialization is not synchronized properly. Could you just write your own to > sub-class with proper synchronization? Are you saying that I should treat my container deriving from CompositeSourceContainer as kind of immutable object, once createSourceContainers() is called? In that case I need to remove my container from its director/container, create a new one, move over all children, make sure dispose() is not call on them. Sound complicated for the simple set to null task I have. Can instead we just have removeAllChildContaniers() that will NOT call dispose() on the children? It will have the same synchronization as dispose(). (In reply to comment #2) > Are you saying that I should treat my container deriving from > CompositeSourceContainer as kind of immutable object, once > createSourceContainers() is called? In short, yes. I didn't design it this way, but it does appear to be so. > In that case I need to remove my container from its director/container, create > a new one, move over all children, make sure dispose() is not call on them. > Sound complicated for the simple set to null task I have. > > Can instead we just have removeAllChildContaniers() that will NOT call > dispose() on the children? > It will have the same synchronization as dispose(). I'm reluctant to change this basic aspect of the class's design because it is a public API and I wouldn't want anyone to be able to start calling the remove method on the standard containers that we have (project, default, etc.). Maybe I'm being paranoid :-) Do you have to subclass this class for your use case (it's < 100 loc)? > Do you have to subclass this class for your use case (it's < 100 loc)?
OK. I give up. I'll copy the class locally... or use reflection for now.
You can reject the bug.
(In reply to comment #4) > > Do you have to subclass this class for your use case (it's < 100 loc)? > > OK. I give up. I'll copy the class locally... or use reflection for now. > You can reject the bug. I don't mean to be difficult. I'd be more open to creating a new (MutableCompositeSourceContainer) along side the existing one if we have a use case for it in open source. |