Commit 4c0ac844 authored by agurov's avatar agurov

Attempted to beginRule: P/xxxx, does not match outer scope rule in...

Attempted to beginRule: P/xxxx, does not match outer scope rule in SVNRemoteStorage [ID-HTT9T] (bug 325407)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=325407

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21507 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 6c8fcf46
......@@ -38,7 +38,9 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.RepositoryProvider;
......@@ -138,14 +140,7 @@ public class SVNRemoteStorage extends AbstractSVNStorage implements IRemoteStora
protected int suggestedLoadDepth = IResource.DEPTH_INFINITE;
protected ISchedulingRule notifyLock = new ISchedulingRule() {
public boolean isConflicting(ISchedulingRule rule) {
return rule == this;
}
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
};
private Job prevNotification = null;
public void resetExternalChangesMonitor() {
this.lastMonitorTime = System.currentTimeMillis();
......@@ -195,28 +190,39 @@ public class SVNRemoteStorage extends AbstractSVNStorage implements IRemoteStora
}
}
}
public void fireResourceStatesChangedEvent(final ResourceStatesChangedEvent event) {
if (event.resources.length > 0) {
// events should be serialized and called asynchronous to caller thread
ProgressMonitorUtility.doTaskScheduled(new AbstractActionOperation("Operation_SendNotifications", SVNMessages.class) { //$NON-NLS-1$
protected void runImpl(IProgressMonitor monitor) throws Exception {
IResourceStatesListener []listeners = null;
synchronized (SVNRemoteStorage.this.resourceStateListeners) {
List<IResourceStatesListener> listenersArray = SVNRemoteStorage.this.resourceStateListeners.get(event.getClass());
if (listenersArray == null) {
return;
}
listeners = listenersArray.toArray(new IResourceStatesListener[listenersArray.size()]);
}
for (int i = 0; i < listeners.length; i++) {
listeners[i].resourcesStateChanged(event);
}
}
public ISchedulingRule getSchedulingRule() {
return SVNRemoteStorage.this.notifyLock;
synchronized (SVNRemoteStorage.this.resourceStateListeners) {
List<IResourceStatesListener> listenersArray = SVNRemoteStorage.this.resourceStateListeners.get(event.getClass());
if (listenersArray == null || listenersArray.size() == 0) {
return;
}
}, true);
final IResourceStatesListener []listeners = listenersArray.toArray(new IResourceStatesListener[listenersArray.size()]);
final Job prevNotify = this.prevNotification;
Job job = new Job("") { //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
if (prevNotify != null) {
try {
prevNotify.join();
}
catch (InterruptedException e) {
return Status.CANCEL_STATUS;
}
}
for (int i = 0; i < listeners.length && !monitor.isCanceled(); i++) {
listeners[i].resourcesStateChanged(event);
}
return monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS;
}
};
job.setSystem(true);
job.schedule();
this.prevNotification = job;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment