From ffc18ac7639691741daf397fee6bf26253bc83a9 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 26 Jan 2011 20:47:21 +0000 Subject: [PATCH] [334837] Ordering of Library list entries incorrect after migration --- .../org/eclipse/rse/core/model/PropertySet.java | 14 ++++++++------ .../rse/core/model/PropertySetContainer.java | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySet.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySet.java index cc28ad503e7..7a8903be942 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySet.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,19 +15,21 @@ * Martin Oberhuber (Wind River) - Added Javadoc. * David McKnight (IBM) - [217715] [api] RSE property sets should support nested property sets * David Dykstal (IBM) - [226561] Add API markup to RSE javadocs for extend / implement + * David McKnight (IBM) - [334837] Ordering of Library list entries incorrect after migration *******************************************************************************/ package org.eclipse.rse.core.model; -import java.util.HashMap; + import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Observable; import java.util.Observer; import java.util.Set; /** - * A Hashmap based implementation of the {@link IPropertySet} interface. + * A LinkedHashmap based implementation of the {@link IPropertySet} interface. * * Not thread-safe since the underlying {@link java.util.HashMap} is * not thread-safe. @@ -51,7 +53,7 @@ public class PropertySet extends RSEModelObject implements IPropertySet, IRSEMod public PropertySet(IPropertySet propertySet) { _name = propertySet.getName(); _description = propertySet.getDescription(); - _properties = new HashMap(); + _properties = new LinkedHashMap(); if (propertySet instanceof ILabeledObject) { ILabeledObject p = (ILabeledObject) propertySet; _label = p.getLabel(); @@ -72,7 +74,7 @@ public class PropertySet extends RSEModelObject implements IPropertySet, IRSEMod */ public PropertySet(String name) { _name = name; - _properties = new HashMap(); + _properties = new LinkedHashMap(); setDirty(true); } @@ -110,7 +112,7 @@ public class PropertySet extends RSEModelObject implements IPropertySet, IRSEMod } public void setProperties(Map map) { - _properties = new HashMap(map.size()); + _properties = new LinkedHashMap(map.size()); for (Iterator z = map.keySet().iterator(); z.hasNext();) { String key = (String) z.next(); Object value = map.get(key); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySetContainer.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySetContainer.java index 99d8cfab49c..476cd224c46 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySetContainer.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/PropertySetContainer.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation. All rights reserved. + * Copyright (c) 2006, 2011 IBM Corporation. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -13,13 +13,14 @@ * Contributors: * David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - [226561] Add API markup to RSE javadocs for extend / implement + * David McKnight (IBM) - [334837] Ordering of Library list entries incorrect after migration ********************************************************************************/ package org.eclipse.rse.core.model; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -32,7 +33,7 @@ public abstract class PropertySetContainer extends RSEPersistableObject implemen private Map _propertySets; public PropertySetContainer() { - _propertySets = new HashMap(); + _propertySets = new LinkedHashMap(); } public IPropertySet[] getPropertySets() {