Commits

Colin Gordon committed 60ca257

34 again, but with more explanation

Comments (0)

Files changed (5)

.results.txt.swp

Binary file modified.
 +1:15 (16:10): 38
 +5 (16:15): 36 (actually 35 after I fixed a stupid typo (@SafeEFfect instead of @SafeEffect) in the stub file)
 +5 (16:20): 34
+
+FetchMembersOperation is really a UI variant of the SVNOperation, but doesn't override canRunAsJob()
+to return false.  But in practice, it's safe because it's always run explicitly from a UI context
+rather than through an IProgressService.
++5 (16:25): 34, but better marked.

src/.log.txt.swp

Binary file modified.
 				parent = display.getActiveShell(); // Colin Gordon: subject to dynamic thread check
 				                               ^
 subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/SVNUIPlugin.java:204: error: Calling a method with UIEffect effect from a context limited to SafeEffect effects.
-			BusyIndicator.showWhile(parent.getDisplay(), new @UI Runnable() {
+			BusyIndicator.showWhile(parent.getDisplay(), new @UI Runnable() { // Colin Gordon: subject to dynamic thread check
 			                       ^
 subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/SVNUIPlugin.java:224: error: Calling a method with UIEffect effect from a context limited to SafeEffect effects.
-			if (createdShell) parent.dispose();
+			if (createdShell) parent.dispose(); // Colin Gordon: subject to dynamic thread check + other control flow for safety
 			                                ^
 subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/SVNUIPlugin.java:428: error: Calling a method with UIEffect effect from a context limited to SafeEffect effects.
 			outerRunnable.run(); // Colin Gordon: SAFE I think - dynamic check for which thread we're on
 				                                                                                                        ^
   cast to Object for a varargs call
   cast to Object[] for a non-varargs call and to suppress this warning
-subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/operations/FetchMembersOperation.java:42: error: Calling a method with UIEffect effect from a context limited to SafeEffect effects.
-			collector.add(children, Policy.subMonitorFor(monitor, 5));
-			             ^
+subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/operations/FetchMembersOperation.java:38: error: An method override may only be @UI if it overrides an @UI method (overriding org.tigris.subversion.subclipse.ui.operations.SVNOperation.execute(org.eclipse.core.runtime.IProgressMonitor)).
+	@UIEffect protected void execute(IProgressMonitor monitor) throws SVNException, InterruptedException { // Colin Gordon: necessary invalid override: only called exlicitly (via run()) from a UI context, not properly used as an Operation.
+	                         ^
 subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/console/ConsoleRemoveAction.java:27: error: Calling a method with UIEffect effect from a context limited to SafeEffect effects.
 		setImageDescriptor(TeamImages.getImageDescriptor("elcl16/participant_rem.gif")); //$NON-NLS-1$
 		                                                ^

src/subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/operations/FetchMembersOperation.java

 import org.tigris.subversion.subclipse.core.ISVNRemoteResource;
 import org.tigris.subversion.subclipse.core.Policy;
 import org.tigris.subversion.subclipse.core.SVNException;
+import guitypes.checkers.quals.*;
 
 /**
  * Fetch the members of a remote folder in the background, passing incremental
 		this.collector = collector;
 	}
 
-	protected void execute(IProgressMonitor monitor) throws SVNException, InterruptedException {
+	@UIEffect protected void execute(IProgressMonitor monitor) throws SVNException, InterruptedException { // Colin Gordon: necessary invalid override: only called exlicitly (via run()) from a UI context, not properly used as an Operation.
 		monitor = Policy.monitorFor(monitor);
 		try {
 			monitor.beginTask(Policy.bind("FetchMembersOperation.message", remoteFolder.getName()), 100);