diff options
author | deboer | 2007-08-29 14:18:33 +0000 |
---|---|---|
committer | deboer | 2007-08-29 14:18:33 +0000 |
commit | 44cfcfe10a0dbbc97e91aeb2450473e04dd25723 (patch) | |
tree | e902911e764c3f775d20d9ec988994305e398539 | |
parent | 159315ed5a01238f1cb717eab7e3e13d6b78af6f (diff) | |
download | webtools.servertools-44cfcfe10a0dbbc97e91aeb2450473e04dd25723.tar.gz webtools.servertools-44cfcfe10a0dbbc97e91aeb2450473e04dd25723.tar.xz webtools.servertools-44cfcfe10a0dbbc97e91aeb2450473e04dd25723.zip |
[201340] Default name/id fix
7 files changed, 82 insertions, 87 deletions
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java index 7d4363c7f..8995211a0 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java @@ -30,13 +30,14 @@ public abstract class Base { protected static final String PROP_PRIVATE = "private"; protected static final String PROP_NAME = "name"; protected static final String PROP_ID = "id"; + protected static final String PROP_ID_SET = "id-set"; protected static final String PROP_TIMESTAMP = "timestamp"; - protected Map map = new HashMap(); - + protected Map<String, Object> map = new HashMap<String, Object>(); + // file loaded from, or null if it is saved in metadata protected IFile file; - + /** * Create a new object. * @@ -54,8 +55,10 @@ public abstract class Base { */ public Base(IFile file, String id) { this.file = file; - //this.map = map; - map.put(PROP_ID, id); + if (id != null && id.length() > 0) { + map.put(PROP_ID, id); + map.put(PROP_ID_SET, Boolean.toString(true)); + } } /** @@ -136,13 +139,15 @@ public abstract class Base { } return defaultValue; } - - public List getAttribute(String attributeName, List defaultValue) { + + @SuppressWarnings("unchecked") + public List<String> getAttribute(String attributeName, List<String> defaultValue) { try { Object obj = map.get(attributeName); if (obj == null) return defaultValue; - List list = (List) obj; + List<String> obj2 = (List<String>) obj; + List<String> list = obj2; if (list != null) return list; } catch (Exception e) { @@ -272,7 +277,7 @@ public abstract class Base { protected abstract void saveState(IMemento memento); protected void load(IMemento memento) { - map = new HashMap(); + map = new HashMap<String, Object>(); Iterator iterator = memento.getNames().iterator(); while (iterator.hasNext()) { @@ -299,7 +304,7 @@ public abstract class Base { protected void loadMap(IMemento memento) { String key = memento.getString("key"); - Map vMap = new HashMap(); + Map<String, String> vMap = new HashMap<String, String>(); List keys = memento.getNames(); Iterator iterator = keys.iterator(); while(iterator.hasNext()) { @@ -313,7 +318,7 @@ public abstract class Base { protected void loadList(IMemento memento) { String key = memento.getString("key"); - List list = new ArrayList(); + List<String> list = new ArrayList<String>(); int i = 0; String key2 = memento.getString("value" + (i++)); while (key2 != null) { @@ -367,7 +372,7 @@ public abstract class Base { IMemento memento = XMLMemento.loadMemento(in); load(memento); } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Could not load from file" + e.getMessage(), e); + Trace.trace(Trace.SEVERE, "Could not load from file", e); throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorLoading, getFile().toString()), e)); } finally { try { @@ -392,7 +397,7 @@ public abstract class Base { IMemento memento = XMLMemento.loadMemento(in); load(memento); } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Could not load from path: " + e.getMessage(), e); + Trace.trace(Trace.SEVERE, "Could not load from path", e); throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorLoading, path.toString()), e)); } finally { try { diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java index c74f28bd8..d1d1defc2 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java @@ -22,7 +22,7 @@ import org.eclipse.wst.server.core.model.RuntimeDelegate; */ public class RuntimeType implements IRuntimeType { private IConfigurationElement element; - private List moduleTypes; + private List<IModuleType> moduleTypes; public RuntimeType(IConfigurationElement element) { super(); @@ -143,6 +143,7 @@ public class RuntimeType implements IRuntimeType { return null; RuntimeWorkingCopy rwc = new RuntimeWorkingCopy(null, id, this); + ServerUtil.setRuntimeDefaultName(rwc); rwc.setDefaults(monitor); return rwc; } diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java index 2968f2de6..f93051ab6 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java @@ -29,7 +29,6 @@ import org.eclipse.wst.server.core.model.RuntimeDelegate; * */ public class RuntimeWorkingCopy extends Runtime implements IRuntimeWorkingCopy { - protected String PROP_ID_SET = "id-set"; protected Runtime runtime; protected WorkingCopyHelper wch; @@ -46,10 +45,10 @@ public class RuntimeWorkingCopy extends Runtime implements IRuntimeWorkingCopy { runtimeType = runtime.getRuntimeType(); - map = new HashMap(runtime.map); + map = new HashMap<String, Object>(runtime.map); wch = new WorkingCopyHelper(this); } - + /** * Create a new runtime working copy for a new runtime. * @@ -61,14 +60,6 @@ public class RuntimeWorkingCopy extends Runtime implements IRuntimeWorkingCopy { super(file, id, runtimeType); wch = new WorkingCopyHelper(this); wch.setDirty(true); - - if (id == null || id.length() == 0) { - id = ServerPlugin.generateId(); - map.put(PROP_ID, id); - } else - setAttribute(PROP_ID_SET, true); - - // throw CoreException if the id already exists } /** @@ -92,12 +83,12 @@ public class RuntimeWorkingCopy extends Runtime implements IRuntimeWorkingCopy { public void setAttribute(String attributeName, boolean value) { wch.setAttribute(attributeName, value); } - + public void setAttribute(String attributeName, String value) { wch.setAttribute(attributeName, value); } - public void setAttribute(String attributeName, List value) { + public void setAttribute(String attributeName, List<String> value) { wch.setAttribute(attributeName, value); } @@ -118,7 +109,7 @@ public class RuntimeWorkingCopy extends Runtime implements IRuntimeWorkingCopy { public void setTestEnvironment(boolean b) { setAttribute(PROP_TEST_ENVIRONMENT, b); } - + /** * @see IRuntimeWorkingCopy#setStub(boolean) */ diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java index 6866a4aef..299a90c2c 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java @@ -36,7 +36,7 @@ public class Server extends Base implements IServer { */ public static final String ATTR_SERVER_ID = "server-id"; - protected static final List EMPTY_LIST = new ArrayList(0); + protected static final List<String> EMPTY_LIST = new ArrayList<String>(0); /** * File extension (value "server") for serialized representation of @@ -76,10 +76,10 @@ public class Server extends Base implements IServer { protected IFolder configuration; // the list of modules that are to be published to the server - protected List modules; + protected List<IModule> modules; // the list of external modules - protected List externalModules; + protected List<IModule> externalModules; // transient fields protected transient String mode = ILaunchManager.RUN_MODE; @@ -87,12 +87,12 @@ public class Server extends Base implements IServer { protected transient int serverSyncState; protected transient boolean serverRestartNeeded; - protected transient Map moduleState = new HashMap(); - protected transient Map modulePublishState = new HashMap(); - protected transient Map moduleRestartState = new HashMap(); + protected transient Map<String, Integer> moduleState = new HashMap<String, Integer>(); + protected transient Map<String, Integer> modulePublishState = new HashMap<String, Integer>(); + protected transient Map<String, Boolean> moduleRestartState = new HashMap<String, Boolean>(); protected transient IStatus serverStatus; - protected transient Map moduleStatus = new HashMap(); + protected transient Map<String, IStatus> moduleStatus = new HashMap<String, IStatus>(); protected transient ServerPublishInfo publishInfo; protected transient AutoPublishThread autoPublishThread; @@ -103,7 +103,7 @@ public class Server extends Base implements IServer { };*/ // publish listeners - protected transient List publishListeners; + protected transient List<IPublishListener> publishListeners; // Server listeners protected transient ServerNotificationManager notificationManager; @@ -164,7 +164,7 @@ public class Server extends Base implements IServer { protected IStatus run(IProgressMonitor monitor) { final boolean[] changed = new boolean[1]; - final List modules2 = new ArrayList(); + final List<IModule[]> modules2 = new ArrayList<IModule[]>(); IModuleVisitor visitor = new IModuleVisitor() { public boolean visit(IModule[] module2) { @@ -354,7 +354,7 @@ public class Server extends Base implements IServer { * * @return a list of publish operation ids */ - public List getDisabledPreferredPublishOperationIds() { + public List<String> getDisabledPreferredPublishOperationIds() { return getAttribute(PROP_DISABLED_PERFERRED_TASKS, EMPTY_LIST); } @@ -364,7 +364,7 @@ public class Server extends Base implements IServer { * * @return a list of publish operation ids */ - public List getEnabledOptionalPublishOperationIds() { + public List<String> getEnabledOptionalPublishOperationIds() { return getAttribute(PROP_ENABLED_OPTIONAL_TASKS, EMPTY_LIST); } @@ -538,12 +538,12 @@ public class Server extends Base implements IServer { return; Boolean b = new Boolean(r); - moduleState.put(getKey(module), b); + moduleRestartState.put(getKey(module), b); fireModuleRestartChangeEvent(module); } public void setExternalModules(IModule[] modules) { - externalModules = new ArrayList(); + externalModules = new ArrayList<IModule>(); if (modules != null) { int size = modules.length; for (int i = 0; i < size; i++) @@ -551,7 +551,7 @@ public class Server extends Base implements IServer { } } - protected List getExternalModules() { + protected List<IModule> getExternalModules() { return externalModules; } @@ -658,7 +658,7 @@ public class Server extends Base implements IServer { Trace.trace(Trace.LISTENERS, "Adding publish listener " + listener + " to " + this); if (publishListeners == null) - publishListeners = new ArrayList(); + publishListeners = new ArrayList<IPublishListener>(); publishListeners.add(listener); } @@ -886,7 +886,7 @@ public class Server extends Base implements IServer { getServerPublishInfo().startCaching(); IStatus status = getBehaviourDelegate(monitor).publish(kind, monitor); - final List modules2 = new ArrayList(); + final List<IModule[]> modules2 = new ArrayList<IModule[]>(); visit(new IModuleVisitor() { public boolean visit(IModule[] module) { if (getModulePublishState(module) == IServer.PUBLISH_STATE_NONE) @@ -919,7 +919,7 @@ public class Server extends Base implements IServer { * @return a possibly empty array of IOptionalTasks */ public PublishOperation[] getTasks(int kind, List moduleList, List kindList) { - List tasks = new ArrayList(); + List<PublishOperation> tasks = new ArrayList<PublishOperation>(); String serverTypeId = getServerType().getId(); @@ -963,11 +963,11 @@ public class Server extends Base implements IServer { Collections.sort(tasks, PUBLISH_OPERATION_COMPARTOR); - return (PublishOperation[]) tasks.toArray(new PublishOperation[tasks.size()]); + return tasks.toArray(new PublishOperation[tasks.size()]); } /** - * Returns all publish tasks that have been targetted to this server type. + * Returns all publish tasks that have been targeted to this server type. * The tasks will not be initialized with a task model. * * @param moduleList a list of modules @@ -978,7 +978,7 @@ public class Server extends Base implements IServer { if (serverTypeId == null) return new PublishOperation[0]; - List tasks = new ArrayList(); + List<PublishOperation> tasks = new ArrayList<PublishOperation>(); IPublishTask[] publishTasks = ServerPlugin.getPublishTasks(); if (publishTasks != null) { @@ -994,7 +994,7 @@ public class Server extends Base implements IServer { Collections.sort(tasks, PUBLISH_OPERATION_COMPARTOR); - return (PublishOperation[])tasks.toArray(new PublishOperation[tasks.size()]); + return tasks.toArray(new PublishOperation[tasks.size()]); } public String getPublishOperationId(PublishOperation op) { @@ -1008,7 +1008,7 @@ public class Server extends Base implements IServer { * @return a list of IModule[] */ public List getAllModules() { - final List moduleList = new ArrayList(); + final List<IModule[]> moduleList = new ArrayList<IModule[]>(); IModuleVisitor visitor = new IModuleVisitor() { public boolean visit(IModule[] module) { @@ -2112,7 +2112,7 @@ public class Server extends Base implements IServer { } protected void setInternal(ServerWorkingCopy wc) { - map = new HashMap(wc.map); + map = new HashMap<String, Object>(wc.map); configuration = wc.configuration; runtime = wc.runtime; serverSyncState = wc.serverSyncState; @@ -2189,7 +2189,7 @@ public class Server extends Base implements IServer { return getDelegate(monitor).canModifyModules(add, remove); } catch (Exception e) { Trace.trace(Trace.SEVERE, "Error calling delegate canModifyModules() " + toString(), e); - return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, e.getMessage(), null); + return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, e.getMessage(), e); } } @@ -2199,11 +2199,11 @@ public class Server extends Base implements IServer { public IModule[] getModules() { if (modules == null) { // convert from attribute - List list = getAttribute(MODULE_LIST, (List) null); + List<String> list = getAttribute(MODULE_LIST, (List<String>) null); if (list == null) - list = new ArrayList(1); + list = new ArrayList<String>(1); - modules = new ArrayList(list.size() + 1); + modules = new ArrayList<IModule>(list.size() + 1); Iterator iterator = list.iterator(); while (iterator.hasNext()) { String moduleId = (String) iterator.next(); @@ -2258,7 +2258,7 @@ public class Server extends Base implements IServer { if (module == null || module.length == 0) throw new IllegalArgumentException("Module cannot be null or empty"); try { - Integer in = (Integer) moduleState.get(getKey(module)); + Integer in = moduleState.get(getKey(module)); if (in != null) return in.intValue(); } catch (Exception e) { @@ -2274,7 +2274,7 @@ public class Server extends Base implements IServer { if (module == null || module.length == 0) throw new IllegalArgumentException("Module cannot be null or empty"); try { - Integer in = (Integer) modulePublishState.get(getKey(module)); + Integer in = modulePublishState.get(getKey(module)); if (in != null) return in.intValue(); } catch (Exception e) { @@ -2316,7 +2316,7 @@ public class Server extends Base implements IServer { try { return getDelegate(monitor).getRootModules(module); } catch (CoreException se) { - //Trace.trace(Trace.FINER, "CoreException calling delegate getParentModules() " + toString() + ": " + se.getMessage()); + //Trace.trace(Trace.FINER, "CoreException calling delegate getParentModules() " + toString(), se); throw se; } catch (Exception e) { Trace.trace(Trace.SEVERE, "Error calling delegate getParentModules() " + toString(), e); @@ -2360,7 +2360,7 @@ public class Server extends Base implements IServer { if (module == null || module.length == 0) throw new IllegalArgumentException("Module cannot be null or empty"); try { - Boolean b = (Boolean) moduleRestartState.get(getKey(module)); + Boolean b = moduleRestartState.get(getKey(module)); if (b != null) return b.booleanValue(); } catch (Exception e) { @@ -2499,7 +2499,7 @@ public class Server extends Base implements IServer { if (module == null || module.length == 0) throw new IllegalArgumentException("Module cannot be null or empty"); try { - return (IStatus) moduleStatus.get(getKey(module)); + return moduleStatus.get(getKey(module)); } catch (Exception e) { return null; } diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java index 9273caeb4..ad98cc105 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java @@ -187,11 +187,10 @@ public class ServerType implements IServerType { if (element == null) return null; - if (id == null || id.length() == 0) - id = ServerPlugin.generateId(); ServerWorkingCopy swc = new ServerWorkingCopy(id, file, runtime, this); if (hasRuntime()) swc.setRuntime(runtime); + ServerUtil.setServerDefaultName(swc); swc.setDefaults(monitor); if (hasServerConfiguration() && runtime != null && runtime.getLocation() != null && !runtime.getLocation().isEmpty()) @@ -215,7 +214,7 @@ public class ServerType implements IServerType { * of the given runtime type */ protected static IRuntime[] getRuntimes(IRuntimeType runtimeType) { - List list = new ArrayList(); + List<IRuntime> list = new ArrayList<IRuntime>(); IRuntime[] runtimes = ServerCore.getRuntimes(); if (runtimes != null) { int size = runtimes.length; @@ -234,9 +233,6 @@ public class ServerType implements IServerType { if (element == null) return null; - if (id == null || id.length() == 0) - id = ServerPlugin.generateId(); - IRuntime runtime = null; if (hasRuntime()) { // look for existing runtime @@ -247,7 +243,7 @@ public class ServerType implements IServerType { else { // create runtime try { - IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(id + "-runtime", monitor); + IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(id, monitor); ServerUtil.setRuntimeDefaultName(runtimeWC); runtime = runtimeWC; } catch (Exception e) { @@ -255,11 +251,11 @@ public class ServerType implements IServerType { } } } - + ServerWorkingCopy swc = new ServerWorkingCopy(id, file, runtime, this); - ServerUtil.setServerDefaultName(swc); if (runtime != null) swc.setRuntime(runtime); + ServerUtil.setServerDefaultName(swc); swc.setDefaults(monitor); if (swc.getServerType().hasServerConfiguration()) diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java index ddd906e9d..adf8fe462 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java @@ -34,24 +34,23 @@ import org.eclipse.wst.server.core.model.ServerDelegate; public class ServerWorkingCopy extends Server implements IServerWorkingCopy { protected Server server; protected WorkingCopyHelper wch; - + protected ServerDelegate workingCopyDelegate; - + // working copy public ServerWorkingCopy(Server server) { super(server.getFile()); this.server = server; - map = new HashMap(server.map); + map = new HashMap<String, Object>(server.map); wch = new WorkingCopyHelper(this); resolve(); } - + // creation public ServerWorkingCopy(String id, IFile file, IRuntime runtime, IServerType serverType) { super(id, file, runtime, serverType); - //server = this; wch = new WorkingCopyHelper(this); wch.setDirty(true); serverState = ((ServerType)serverType).getInitialState(); @@ -185,7 +184,7 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { wch.setAttribute(attributeName, value); } - public void setAttribute(String attributeName, List value) { + public void setAttribute(String attributeName, List<String> value) { wch.setAttribute(attributeName, value); } @@ -198,6 +197,9 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { */ public void setName(String name) { setAttribute(PROP_NAME, name); + boolean set = getAttribute(PROP_ID_SET, false); + if (runtime == null && !set) + setAttribute(PROP_ID, name); } public void setReadOnly(boolean b) { @@ -245,9 +247,9 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { * @return true if change is made. */ public boolean disablePreferredPublishOperations(PublishOperation op) { - List list = getAttribute(PROP_DISABLED_PERFERRED_TASKS, (List)null); + List<String> list = getAttribute(PROP_DISABLED_PERFERRED_TASKS, (List<String>)null); if (list == null) - list = new ArrayList(); + list = new ArrayList<String>(); String opId = getPublishOperationId(op); if (list.contains(opId)) @@ -264,9 +266,9 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { * @return true if change is made. */ public boolean enableOptionalPublishOperations(PublishOperation op) { - List list = getAttribute(PROP_ENABLED_OPTIONAL_TASKS, (List)null); + List<String> list = getAttribute(PROP_ENABLED_OPTIONAL_TASKS, (List<String>)null); if (list == null) - list = new ArrayList(); + list = new ArrayList<String>(); String opId = getPublishOperationId(op); if (list.contains(opId)) @@ -280,14 +282,14 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { * Reset all preferred operations to default */ public void resetPreferredPublishOperations() { - setAttribute(PROP_DISABLED_PERFERRED_TASKS, (List)null); + setAttribute(PROP_DISABLED_PERFERRED_TASKS, (List<String>)null); } /** * Reset all optional operations to default */ public void resetOptionalPublishOperations() { - setAttribute(PROP_ENABLED_OPTIONAL_TASKS, (List)null); + setAttribute(PROP_ENABLED_OPTIONAL_TASKS, (List<String>)null); } /** @@ -530,7 +532,7 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { } // convert to attribute - List list = new ArrayList(); + List<String> list = new ArrayList<String>(); Iterator iterator = modules.iterator(); while (iterator.hasNext()) { IModule module = (IModule) iterator.next(); @@ -727,7 +729,7 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy { super.setExternalModules(modules); } - public List getExternalModules() { + public List<IModule> getExternalModules() { if (server != null) return server.getExternalModules(); return super.getExternalModules(); diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java index e165a4fdd..81a50ae0a 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java @@ -29,7 +29,7 @@ public class WorkingCopyHelper { protected boolean isDirty; // property change listeners - private transient List propertyListeners; + private transient List<PropertyChangeListener> propertyListeners; public WorkingCopyHelper(Base base) { this.base = base; @@ -68,8 +68,8 @@ public class WorkingCopyHelper { firePropertyChangeEvent(attributeName, current, value); } - public void setAttribute(String attributeName, List value) { - List current = base.getAttribute(attributeName, (List)null); + public void setAttribute(String attributeName, List<String> value) { + List current = base.getAttribute(attributeName, (List<String>)null); if (base.isAttributeSet(attributeName) && current != null && current.equals(value)) return; @@ -125,7 +125,7 @@ public class WorkingCopyHelper { */ public void addPropertyChangeListener(PropertyChangeListener listener) { if (propertyListeners == null) - propertyListeners = new ArrayList(2); + propertyListeners = new ArrayList<PropertyChangeListener>(2); propertyListeners.add(listener); } |