public IResource[] members(IResource resource) throws TeamException {
synchronized (_refreshLock ) {
Map<IPath, IResource> existingChildren = new HashMap<IPath, IResource>();
for (IPath path : _localStates.keySet()) {
if (isAffected(path, true)) {
IResource child = convertToResource(_localStates.get(path));
if (child != null) {
_localStatesByResource.put(child, _localStates.get(path));
// add highest parent
IResource parent = child;
while (parent != null) {
IResource grandParent = parent.getParent();
if (grandParent != null && grandParent.getFullPath().equals(resource.getFullPath())) {
existingChildren.put(parent.getFullPath(), parent);
break;
}
parent = grandParent;
}
}
}
}
for (IPath path : _remoteStates.keySet()) {
if (isAffected(path, false)) {
IResource child = convertToResource(_remoteStates.get(path));
if (child != null) {
_remoteStatesByResource.put(child, _remoteStates.get(path));
// add highest parent
IResource parent = child;
while (parent != null) {
IResource grandParent = parent.getParent();
if (grandParent != null && grandParent.getFullPath().equals(resource.getFullPath())) {
existingChildren.put(parent.getFullPath(), parent);
break;
}
parent = grandParent;
}
}
}
}
IResource virtualPluginRoot = retrieveVirtualPluginRoot(_runtime);
if (resource instanceof IProject) {
existingChildren.put(virtualPluginRoot.getFullPath(), virtualPluginRoot);
} else if (resource.getFullPath().equals(virtualPluginRoot.getFullPath())) {
for (IResource virtualPluginResource : _localPluginInfos.keySet()) {
existingChildren.put(virtualPluginResource.getFullPath(), virtualPluginResource);
}
for (IResource virtualPluginResource : _remotePluginInfos.keySet()) {
existingChildren.put(virtualPluginResource.getFullPath(), virtualPluginResource);