Bug 186128 - [api][breaking] IProgressMonitor argument should always be last for consistency
Summary: [api][breaking] IProgressMonitor argument should always be last for consistency
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-05-09 07:38 EDT by Martin Oberhuber CLA
Modified: 2008-08-13 13:18 EDT (History)
0 users

See Also:


Attachments
Refactoring Script for method parameter ordering change (50.16 KB, text/plain)
2007-05-10 10:22 EDT, Martin Oberhuber CLA
no flags Details
Refactoring Script for public base classes (42.47 KB, text/plain)
2007-05-14 06:39 EDT, Martin Oberhuber CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-05-09 07:38:02 EDT
In IFileService, the IProgressMonitor argument always appears first in all methods. In IRemoteFileSubSystem, it is mostly last except for 
  IRemoteFileSubSystem#setLastModified()
  IRemoteFileSubSystem#setReadOnly()
which have it first.

Most other parts of Eclipse always have the IProgressMonitor last in the argument list: Platform Core Resources (IWorkspace, IFileStore), Platform Team (ISynchronizeParticipant), CDT (IIndexManager) so we should unify this if we've got the chance to do breaking API changes for TM 2.0.
Comment 1 Martin Oberhuber CLA 2007-05-09 07:52:36 EDT
Affected methods in interfaces:

IFileService#upload()
IFileService#download()
IFileService#getFile()
IFileService#getFilesAndFolders()
IFileService#getFiles()
IFileService#getFolders()
IFileService#createFile()
IFileService#createFolder()
IFileService#delete()
IFileService#deleteBatch()
IFileService#rename()
IFileService#move()
IFileService#copy()
IFileService#copyBatch()
IFileService#setLastModified()
IFileService#setReadOnly()
IFileService#getInputStream()
IFileService#getOutputStream()

IProcessService#listAllProcesses()
IProcessService#listAllProcesses()
IProcessService#listChildProcesses()
IProcessService#getParentProcess()
IProcessService#getProcess()
IProcessService#kill()

ISearchService#search()
ISearchService#cancelSearch()

IShellService#launchShell()
IShellService#runCommand()

ISubSystem#connect()
ISubSystem#resolveFilterString()
ISubSystem#resolveFilterStrings()

IRemoteCmdSubSystem#runCommand()
IRemoteCmdSubSystem#runShell()
IRemoteCmdSubSystem#sendCommandToShell()
IRemoteCmdSubSystem#cancelShell()

IRemoteFileSubSystem#setLastModified()
IRemoteFileSubSystem#setReadOnly()

IServerLauncher#connect()

ISystemRegistry#copySystemProfile()
ISystemRegistry#copyHost()
ISystemRegistry#moveHost()

ISystemViewElementAdapter#getChildren()
Comment 2 Martin Oberhuber CLA 2007-05-10 10:22:07 EDT
Created attachment 66676 [details]
Refactoring Script for method parameter ordering change

Work completed, checkin comment: 
[186128][api] Move IProgressMonitor last in all API

In order to apply the changes to a local workspace, just choose
Refactor > Apply Script... in Eclipse, and load attached
refactoring script.

The IProgressMonitor argument has been moved last in all
the cases mentioned in comment #1, with the only exception
of ISubSystem#connect(IProgressMonitor, boolean); in that
case, it was kept as-is in order to be not ambiguous 
against ISubSystem#connect(boolean, IRSECallback).

At the same time, deprecated old methods in ISubSystem
which did not have an IProgressMonitor argument but
should have one were removed:
  resolveFilterString(String)
  resolveFilterString(Object, String)
  resolveFilterStrings(String[])

For migration of these, just add a "new NullProgressMonitor()"
argument to your existing calls. For migration of all the 
others, just apply the refactoring script.
Comment 3 Martin Oberhuber CLA 2007-05-10 10:22:43 EDT
Work complete. See comment #2 for migration notes.
Comment 4 Martin Oberhuber CLA 2007-05-14 05:44:32 EDT
Additional checkin for protected methods in public base classes, comment:
[186128][refactoring] Move IProgressMonitor last in public base classes 

Affected classes and methods:
AbstractSearchService#internalSearch()

FileServiceSubSystem#getFile()
FileServiceSubSystem#getFiles()
FileServiceSubSystem#getFolders()
FileServiceSubSystem#getFilesAndFolders()

IFileService#rename()

SubSystem#internalResoveFilterString()
SubSystem#internalResoveFilterStrings()
SubSystem#internalGetProperty()
SubSystem#internalSetProperty()
SubSystem#internalGetProperties()
SubSystem#internalSetProperties()

RemoteCmdSubSystem#internalRunCommand()
RemoteCmdSubSystem#internalRunShell()
RemoteCmdSubSystem#internalCancelShell()
RemoteCmdSubSystem#internalSendCommandToShell()

RemoteFileSubSystem#internalResolveOneFilterString()

AbstractDStoreService#dsQueryCommand()
AbstractDStoreService#dsStatusCommand()

DStoreConnectorService#launchUsingRExec()
DStoreFileService#fetch()
Comment 5 Martin Oberhuber CLA 2007-05-14 06:39:19 EDT
Created attachment 67033 [details]
Refactoring Script for public base classes

Attached refactoring script can be replayed to move the progress monitor last in public base classes. Must be replayed after the first one!
Comment 6 Martin Oberhuber CLA 2008-08-13 13:18:29 EDT
[target cleanup] 2.0 M7 was the original target milestone for this bug