1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-07 16:26:11 +02:00

Removing dead code.

This commit is contained in:
David Dykstal 2006-06-14 17:56:36 +00:00
parent d7cfe36b48
commit ad98ea3625
8 changed files with 81 additions and 85 deletions

View file

@ -381,10 +381,13 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
targetFilter.setStringsCaseSensitive(isStringsCaseSensitive()); targetFilter.setStringsCaseSensitive(isStringsCaseSensitive());
// clone filter strings // clone filter strings
ISystemFilterString[] strings = getSystemFilterStrings(); ISystemFilterString[] strings = getSystemFilterStrings();
ISystemFilterString newString = null; // ISystemFilterString newString = null; DWD - useless code, remove this after testing.
if (strings != null) if (strings != null) {
for (int idx=0; idx<strings.length; idx++) for (int idx=0; idx<strings.length; idx++) {
newString = copySystemFilterString(targetFilter, strings[idx]); // newString = copySystemFilterString(targetFilter, strings[idx]); DWD useless code, remove after testing
copySystemFilterString(targetFilter, strings[idx]);
}
}
// clone nested filters... // clone nested filters...
ISystemFilter[] filters = getSystemFilters(); ISystemFilter[] filters = getSystemFilters();
if (filters != null) if (filters != null)
@ -649,7 +652,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
if (filterStringVector == null) if (filterStringVector == null)
{ {
java.util.List el = internalGetFilterStrings(); java.util.List el = internalGetFilterStrings();
ISystemFilterString[] strings = new ISystemFilterString[el.size()]; // ISystemFilterString[] strings = new ISystemFilterString[el.size()]; DWD - useless code.
Iterator i = el.iterator(); Iterator i = el.iterator();
filterStringVector = new Vector(); filterStringVector = new Vector();
while (i.hasNext()) while (i.hasNext())

View file

@ -19,7 +19,6 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.Vector; import java.util.Vector;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
@ -88,8 +87,8 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
protected static final String DELIMITER = SystemFilterPoolReference.DELIMITER; protected static final String DELIMITER = SystemFilterPoolReference.DELIMITER;
// persistence // persistence
protected boolean _isDirty = true; // protected boolean _isDirty = true; FIXME
protected boolean _wasRestored = false; // protected boolean _wasRestored = false; FIXME
/** /**
* @generated This field/method will be replaced during code generation. * @generated This field/method will be replaced during code generation.
@ -715,7 +714,8 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
{ {
for (int idx=0; idx<filters.length; idx++) for (int idx=0; idx<filters.length; idx++)
{ {
ISystemFilter newFilter = copySystemFilter(targetPool, filters[idx], filters[idx].getName()); // ISystemFilter newFilter = copySystemFilter(targetPool, filters[idx], filters[idx].getName()); DWD - useless assignment.
copySystemFilter(targetPool, filters[idx], filters[idx].getName());
} }
} }
} }
@ -927,11 +927,11 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* Return the save file that will be written for the given filter pool. * Return the save file that will be written for the given filter pool.
* Will depend on this manager's save policy. * Will depend on this manager's save policy.
*/ */
public IFile getSaveFile() // public IFile getSaveFile() DWD - useless, not called since persistence model has changed.
{ // {
String fileName = getRootSaveFileName(this); // String fileName = getRootSaveFileName(this);
return null;//FIXME SystemMOFHelpers.getSaveFile(getFolder(),fileName); // return null;//FIXME SystemMOFHelpers.getSaveFile(getFolder(),fileName);
} // }
@ -1020,14 +1020,14 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
/** /**
* Do restore when all filters in this pool are stored in a single file. * Do restore when all filters in this pool are stored in a single file.
*/ */
protected static ISystemFilterPool restoreFromOneFile(IFolder folder, String name, // protected static ISystemFilterPool restoreFromOneFile(IFolder folder, String name,
ISystemFilterNamingPolicy namingPolicy, // ISystemFilterNamingPolicy namingPolicy,
boolean restoreFilters) // boolean restoreFilters) DWD - useless, not called since persistence model has changed
throws Exception // throws Exception
{ // {
//
String fileName = getRootSaveFileName(namingPolicy, name); // String fileName = getRootSaveFileName(namingPolicy, name);
ISystemFilterPool pool = null; // ISystemFilterPool pool = null;
/*FIXME /*FIXME
if (!restoreFilters && !SystemResourceHelpers.getResourceHelpers().getFile(folder, fileName+".xmi").exists()) if (!restoreFilters && !SystemResourceHelpers.getResourceHelpers().getFile(folder, fileName+".xmi").exists())
{ {
@ -1055,8 +1055,8 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
else else
RSEUIPlugin.logInfo("Hmmm, pool is still null after restore: " + fileName+".xmi"); RSEUIPlugin.logInfo("Hmmm, pool is still null after restore: " + fileName+".xmi");
*/ */
return pool; // return pool;
} // }
/** /**
* Internal use method * Internal use method
@ -1367,31 +1367,31 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
} }
} }
public boolean isDirty() // public boolean isDirty() DWD - useless and dangerous code, overrides default with same
{ // {
return _isDirty; // return _isDirty;
} // }
public void setDirty(boolean flag) // public void setDirty(boolean flag) DWD - useless and dangerous code, overrides default with same
{ // {
if (_isDirty != flag) // if (_isDirty != flag)
{ // {
_isDirty= flag; // _isDirty= flag;
} // }
} // }
public boolean commit() public boolean commit()
{ {
return RSEUIPlugin.getThePersistenceManager().commit(this); return RSEUIPlugin.getThePersistenceManager().commit(this);
} }
public boolean wasRestored() // public boolean wasRestored() DWD - useless and dangerous code, overrides default with same
{ // {
return _wasRestored; // return _wasRestored;
} // }
public void setWasRestored(boolean flag) // public void setWasRestored(boolean flag) DWD - useless and dangerous code, overrides default with same
{ // {
_wasRestored = flag; // _wasRestored = flag;
} // }
} }

View file

@ -663,7 +663,8 @@ public class SystemFilterPoolManager implements ISystemFilterPoolManager
} }
} }
} }
String poolName = pool.getName(); // String poolName = pool.getName(); DWD - useless code
// DWD removing a pool should mark its parent profile as dirty and cause a save to be "scheduled"
// remove from model // remove from model
java.util.List pools = getPools(); java.util.List pools = getPools();
@ -734,7 +735,13 @@ public class SystemFilterPoolManager implements ISystemFilterPoolManager
public boolean preTestRenameFilterPool(ISystemFilterPool pool) throws Exception public boolean preTestRenameFilterPool(ISystemFilterPool pool) throws Exception
{ {
boolean ok = true; boolean ok = true;
String oldName = pool.getName(); // String oldName = pool.getName(); DWD temporarily removed.
/*
* DWD this looks like it needs to be modified so that it queries the persistence
* manager to see if the pool can be renamed. The provider is in charge of determining
* pool names in the persistent form. The Manager will have to construct a DOM
* object for this pool and query the appropriate provider.
*/
/* FIXME /* FIXME
if ( (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL) || if ( (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL) ||
(savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER) ) (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER) )
@ -803,9 +810,14 @@ public class SystemFilterPoolManager implements ISystemFilterPoolManager
public void renameSystemFilterPool(ISystemFilterPool pool, String newName) public void renameSystemFilterPool(ISystemFilterPool pool, String newName)
throws Exception throws Exception
{ {
/*
* DWD Renaming a filter pool should mark its parent profile as dirty and
* the pool itself as dirty. A rewrite of the profile should be scheduled.
*/
String oldName = pool.getName(); String oldName = pool.getName();
int oldLen = oldName.length(); // int oldLen = oldName.length(); DWD temporarily(?) removed
int newLen = newName.length(); // int newLen = newName.length(); DWD temporarily(?) removed
// rename on disk // rename on disk
/* FIXME /* FIXME
if ( (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL) || if ( (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL) ||
@ -1353,7 +1365,10 @@ public class SystemFilterPoolManager implements ISystemFilterPoolManager
public void moveSystemFilters(ISystemFilter filters[], int delta) public void moveSystemFilters(ISystemFilter filters[], int delta)
throws Exception throws Exception
{ {
ISystemFilterContainer container = filters[0].getParentFilterContainer(); /*
* DWD revisit this. Make sure that the pool is scheduled to be saved.
*/
// ISystemFilterContainer container = filters[0].getParentFilterContainer(); DWD temporarily(?) removed.
int[] oldPositions = new int[filters.length]; int[] oldPositions = new int[filters.length];
for (int idx=0; idx<filters.length; idx++) for (int idx=0; idx<filters.length; idx++)
oldPositions[idx] = getSystemFilterPosition(filters[idx]); oldPositions[idx] = getSystemFilterPosition(filters[idx]);
@ -1550,10 +1565,13 @@ public class SystemFilterPoolManager implements ISystemFilterPoolManager
public ISystemFilterString copySystemFilterString(ISystemFilter targetFilter, ISystemFilterString oldFilterString) public ISystemFilterString copySystemFilterString(ISystemFilter targetFilter, ISystemFilterString oldFilterString)
throws Exception throws Exception
{ {
/*
* DWD revisit this. make sure that pool is persisted.
*/
ISystemFilterPool targetPool = targetFilter.getParentFilterPool(); ISystemFilterPool targetPool = targetFilter.getParentFilterPool();
ISystemFilterPoolManager targetMgr = targetPool.getSystemFilterPoolManager(); ISystemFilterPoolManager targetMgr = targetPool.getSystemFilterPoolManager();
ISystemFilter oldFilter = oldFilterString.getParentSystemFilter(); ISystemFilter oldFilter = oldFilterString.getParentSystemFilter();
ISystemFilterPool oldPool = oldFilter.getParentFilterPool(); // ISystemFilterPool oldPool = oldFilter.getParentFilterPool(); DWD temporarily(?) removed.
targetMgr.suspendCallbacks(true); targetMgr.suspendCallbacks(true);

View file

@ -31,6 +31,10 @@ import org.eclipse.rse.references.ISystemBaseReferencedObject;
/** /**
* A reference to a system filter string. * A reference to a system filter string.
*/ */
/*
* DWD What is a filter string REFERENCE? Where would this be used?
*/
public class SystemFilterStringReference public class SystemFilterStringReference
implements ISystemFilterStringReference, IAdaptable implements ISystemFilterStringReference, IAdaptable
{ {
@ -73,7 +77,6 @@ public class SystemFilterStringReference
*/ */
public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager() public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
{ {
ISystemFilterReference filter = getParent();
if (parent != null) if (parent != null)
return parent.getFilterPoolReferenceManager(); return parent.getFilterPoolReferenceManager();
return null; return null;

View file

@ -267,7 +267,7 @@ public class Host extends RSEModelObject implements IHost, IAdaptable
*/ */
public void setAliasName(String newName) public void setAliasName(String newName)
{ {
String oldName = getAliasName(); // what it used to be. // String oldName = getAliasName(); DWD temporarily(?) removed
String userIdValue = null; String userIdValue = null;
if (previousUserIdKey != null) if (previousUserIdKey != null)
userIdValue = getLocalDefaultUserId(previousUserIdKey); userIdValue = getLocalDefaultUserId(previousUserIdKey);

View file

@ -41,7 +41,7 @@ public abstract class SystemPersistableReferencingObject extends SystemReferenci
*/ */
protected static final String REFERENCED_OBJECT_NAME_EDEFAULT = null; protected static final String REFERENCED_OBJECT_NAME_EDEFAULT = null;
private SystemReferencingObjectHelper helper = null; // private SystemReferencingObjectHelper helper = null; DWD dangerous, overriding and covering superclass
/** /**
* @generated This field/method will be replaced during code generation. * @generated This field/method will be replaced during code generation.

View file

@ -142,9 +142,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
protected boolean _connectionError = false; protected boolean _connectionError = false;
protected boolean _disconnecting = false; protected boolean _disconnecting = false;
protected boolean _isDirty = true;
protected boolean _wasRestored = false;
protected IHost _host; protected IHost _host;
@ -685,6 +682,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
* since it names a team sharable resource. Not qualified by the profile * since it names a team sharable resource. Not qualified by the profile
* name since that is implicit by being in a profile. * name since that is implicit by being in a profile.
*/ */
// DWD - does not appear to be used.
String name = "CN-" + connectionName; String name = "CN-" + connectionName;
return name; return name;
} }
@ -3312,35 +3310,9 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
else return false; else return false;
} }
public boolean isDirty()
{
return _isDirty;
}
public void setDirty(boolean flag)
{
if (_isDirty != flag)
{
_isDirty = flag;
}
}
public boolean commit() public boolean commit()
{ {
return RSEUIPlugin.getThePersistenceManager().commit(this); return RSEUIPlugin.getThePersistenceManager().commit(this);
} }
public boolean wasRestored()
{
return _wasRestored;
}
public void setWasRestored(boolean flag)
{
_wasRestored = flag;
}
} }

View file

@ -852,7 +852,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
*/ */
public ISystemValidator getUserIdValidator() public ISystemValidator getUserIdValidator()
{ {
RSEUIPlugin sp = RSEUIPlugin.getDefault(); // RSEUIPlugin sp = RSEUIPlugin.getDefault(); DWD - to be removed. Appears to be useless.
ISystemValidator userIdValidator = ISystemValidator userIdValidator =
new ValidatorSpecialChar( new ValidatorSpecialChar(
"=;", "=;",
@ -1106,8 +1106,8 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
java.util.List mofList = getSubSystemList(); java.util.List mofList = getSubSystemList();
Iterator i = mofList.iterator(); Iterator i = mofList.iterator();
Vector v = new Vector(); Vector v = new Vector();
String connProfileName = conn.getSystemProfile().getName(); // String connProfileName = conn.getSystemProfile().getName(); DWD - to be removed, appears to be useless.
String connAliasName = conn.getAliasName(); // String connAliasName = conn.getAliasName(); DWD - to be removed.
while (i.hasNext()) while (i.hasNext())
{ {
ISubSystem subsys = (ISubSystem) i.next(); ISubSystem subsys = (ISubSystem) i.next();
@ -1125,7 +1125,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
*/ */
public ISubSystem[] getSubSystems(ISystemProfile profile) public ISubSystem[] getSubSystems(ISystemProfile profile)
{ {
String profileName = profile.getName(); // String profileName = profile.getName(); DWD - to be removed.
ISubSystem[] allSubSystems = getSubSystems(true); ISubSystem[] allSubSystems = getSubSystems(true);
Vector v = new Vector(); Vector v = new Vector();
for (int idx = 0; idx < allSubSystems.length; idx++) for (int idx = 0; idx < allSubSystems.length; idx++)