Bug 150388 - [api] SubSystem class should provide default imple for (un)initializeSubSystem
Summary: [api] SubSystem class should provide default imple for (un)initializeSubSystem
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.0.1   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-07-12 09:55 EDT by Martin Oberhuber CLA
Modified: 2007-05-23 05:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2006-07-12 09:55:23 EDT
Simple SubSystems do not need initialization.
Therefore, the SubSystem base class should provide a default implementation, doing nothing.
Comment 1 Martin Oberhuber CLA 2006-11-20 06:55:14 EST
Default implementations in an abstract superclass do not break API but make programming and using the API simpler.
The fix is trivial, and I'd love to see this for 1.0.1
Comment 2 David Dykstal CLA 2006-12-12 09:03:00 EST
Default implementations of initializeSubSystem and uninitializeSubSystem have been provided.
Comment 3 Javier Montalvo Orús CLA 2006-12-13 12:54:28 EST
A declaration for initializeSubSystem has been provided in SubSystem but not for uninitializeSubSystem. 
Also the method is declared abstract, and from the bug title and description I would expect a really simple subsystem to use directly the empty implementation from SubSystem, so it shouldn't be abtract.
Comment 4 Javier Montalvo Orús CLA 2006-12-13 13:12:31 EST
This patch could fix the bug:

### Eclipse Workspace Patch 1.0
#P org.eclipse.rse.ui
Index: subsystems/org/eclipse/rse/core/subsystems/SubSystem.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java,v
retrieving revision 1.43
diff -u -r1.43 SubSystem.java
--- subsystems/org/eclipse/rse/core/subsystems/SubSystem.java	5 Dec 2006 00:20:15 -0000	1.43
+++ subsystems/org/eclipse/rse/core/subsystems/SubSystem.java	13 Dec 2006 18:02:44 -0000
@@ -2467,7 +2467,12 @@
      * This method should be overridden if any initialization for the subsystem needs
      * to occur at this time
      */
-    public abstract void initializeSubSystem(IProgressMonitor monitor);
+    public void initializeSubSystem(IProgressMonitor monitor){}
+    
+    /**
+	 * Called on each subsystem associated with a particular IConnectorService after it disconnects
+	 */
+	public void uninitializeSubSystem(IProgressMonitor monitor){}
 
 
     /**
Comment 5 David Dykstal CLA 2006-12-13 15:11:52 EST
You are correct. The change was not submitted at the last minute while debugging another problem. It will be placed back in later today after verification is completed.
Comment 6 David Dykstal CLA 2006-12-13 23:01:15 EST
Let's try this again :) - providing default implementations of initializeSubSystem and uninitializeSubSystem.