318736 ImportDataModel unsafely checks java facet name
314295 Need java facet aliasing/compatibility for Ganymede stream
diff --git a/plugins/org.eclipse.jst.common.project.facet.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.common.project.facet.core/META-INF/MANIFEST.MF
index 641f20d..c620893 100644
--- a/plugins/org.eclipse.jst.common.project.facet.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.common.project.facet.core/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
 Bundle-Vendor: %providerName
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.common.project.facet.core; singleton:=true
-Bundle-Version: 1.3.3.qualifier
+Bundle-Version: 1.3.4.qualifier
 Bundle-ClassPath: .
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jst.common.project.facet.core,
diff --git a/plugins/org.eclipse.jst.common.project.facet.core/plugin.xml b/plugins/org.eclipse.jst.common.project.facet.core/plugin.xml
index d9b24bb..de57bc3 100644
--- a/plugins/org.eclipse.jst.common.project.facet.core/plugin.xml
+++ b/plugins/org.eclipse.jst.common.project.facet.core/plugin.xml
@@ -106,7 +106,13 @@
     <validator class="org.eclipse.jst.common.project.facet.core.internal.JavaFacetValidator">
       <facet id="jst.java"/>
     </validator>
-  </extension>    
+  </extension>
+  
+  <extension point="org.eclipse.wst.common.project.facet.core.aliases">
+    <facet-alias facet="jst.java" alias="java"/>
+    <facet-version-alias facet="jst.java" version="5.0" alias="1.5"/>
+    <facet-version-alias facet="jst.java" version="6.0" alias="1.6"/>
+  </extension>
 
   <extension 
     point="org.eclipse.core.resources.markers"
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.common.project.facet.core/META-INF/MANIFEST.MF
index b87c007..7decb4f 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.common.project.facet.core/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
 Bundle-Vendor: %providerName
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.common.project.facet.core; singleton:=true
-Bundle-Version: 1.3.5.qualifier
+Bundle-Version: 1.3.6.qualifier
 Bundle-ClassPath: .
 Bundle-Localization: plugin
 Export-Package: org.eclipse.wst.common.project.facet.core,
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/plugin.properties b/plugins/org.eclipse.wst.common.project.facet.core/plugin.properties
index 9950a1a..05d366a 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/plugin.properties
+++ b/plugins/org.eclipse.wst.common.project.facet.core/plugin.properties
@@ -4,3 +4,4 @@
 validationMarkerName = Faceted Project Problem
 extPointListeners = Faceted Project Listeners Extension Point
 extPointPresets = Faceted Project Presets
+extPointAliases = Project Facet Aliases Extension Point
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/plugin.xml b/plugins/org.eclipse.wst.common.project.facet.core/plugin.xml
index 041f7f8..d25cb77 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/plugin.xml
+++ b/plugins/org.eclipse.wst.common.project.facet.core/plugin.xml
@@ -37,7 +37,12 @@
     id="presets" 
     name="%extPointPresets" 
     schema="schemas/presets.exsd"/>
-  
+    
+  <extension-point 
+    id="aliases" 
+    name="%extPointAliases" 
+    schema="schemas/aliases.exsd"/>
+      
   <extension
     id="nature"
     point="org.eclipse.core.resources.natures">
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/schemas/aliases.exsd b/plugins/org.eclipse.wst.common.project.facet.core/schemas/aliases.exsd
new file mode 100644
index 0000000..755eaf5
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.core/schemas/aliases.exsd
@@ -0,0 +1,139 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.project.facet.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.common.project.facet.core" id="aliases" name="Project Facet Aliases Extension Point"/>
+      </appInfo>
+      <documentation>
+         Used as part of a migration strategy in order to maintain backwards compatibility when changing the id or the version of a facet. Allows one or more aliases to be defined for facet id or version. Once an alias is defined, it will resolve to the actual facet when it appears in project metadata or is referenced in an API call.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
+      <complexType>
+         <choice minOccurs="1" maxOccurs="unbounded">
+            <element ref="facet-alias"/>
+            <element ref="facet-version-alias"/>
+         </choice>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  A fully qualified identifier of the target extension point.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  An optional identifier of the extension instance.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  An optional name of the extension instance.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="facet-alias">
+      <annotation>
+         <documentation>
+            Specifies a single facet alias.
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="facet" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The id of an existing facet.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.wst.common.project.facet.core.facets/project-facet/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="alias" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The alias to assign to the specified facet.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="facet-version-alias">
+      <annotation>
+         <documentation>
+            Specifies a single facet version alias.
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="facet" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The id of an existing facet.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.wst.common.project.facet.core.facets/project-facet/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="version" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The facet version to alias.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="alias" type="string">
+            <annotation>
+               <documentation>
+                  The alias to assign to the specified facet version.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         &lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.wst.common.project.facet.core.aliases&quot;&gt;
+  &lt;facet-alias facet=&quot;mytech&quot; alias=&quot;formgen&quot;/&gt;
+  &lt;facet-version-alias facet=&quot;mytech&quot; version=&quot;1.5&quot; alias=&quot;2.0&quot;/&gt;
+&lt;/extension&gt;
+&lt;/pre&gt;
+      </documentation>
+   </annotation>
+
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2010 Oracle and others.&lt;br&gt;
+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 &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacet.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacet.java
index 7ac330f..14407db 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacet.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacet.java
@@ -50,6 +50,15 @@
     String getId();
     
     /**
+     * Returns the alternate identifiers that are associated with this facet. Aliases are specified
+     * via the <code>aliases</code> extension point.
+     * 
+     * @return the alternate identifiers that are associated with this facet, if any
+     */
+    
+    Set<String> getAliases();
+    
+    /**
      * Returns the id of the plugin that defines this project facet. This method
      * will return <code>null</code> if this facet is not defined. 
      * 
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java
index 14f11dc..f9ac0f5 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java
@@ -46,6 +46,15 @@
     String getVersionString();
     
     /**
+     * Returns the alternate version strings that are associated with this facet version. Aliases 
+     * are specified via the <code>aliases</code> extension point.
+     * 
+     * @return the alternate version strings that are associated with this facet version, if any
+     */
+    
+    Set<String> getAliases();
+    
+    /**
      * Returns the id of the plugin that defines this project facet version. 
      * This method will return <code>null</code> if this version is not defined. 
      * 
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.java
index 7bf677e..a9e4c7c 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.java
@@ -139,6 +139,8 @@
     private final Set<IProjectFacet> fixed;
     private final Set<IProjectFacet> fixedReadOnly;
     private final Map<String,ProjectFacet> unknownFacets;
+    private final Map<IProjectFacet,String> activeFacetAliases;
+    private final Map<IProjectFacetVersion,String> activeFacetVersionAliases;
     private final Set<String> targetedRuntimes;
     private String primaryRuntime;
     IFile f;
@@ -161,6 +163,8 @@
         this.fixed = new CopyOnWriteArraySet<IProjectFacet>();
         this.fixedReadOnly = Collections.unmodifiableSet( this.fixed );
         this.unknownFacets = new HashMap<String,ProjectFacet>();
+        this.activeFacetAliases = new HashMap<IProjectFacet,String>();
+        this.activeFacetVersionAliases = new HashMap<IProjectFacetVersion,String>();
         this.targetedRuntimes = new CopyOnWriteArraySet<String>();
         this.listeners = new ProjectListenerRegistry();
         this.parsingException = null;
@@ -1499,18 +1503,29 @@
         
         for( IProjectFacet f : this.fixed )
         {
+            String fid = this.activeFacetAliases.get( f );
+            fid = ( fid == null ? f.getId() : fid );
+            
             out.print( "  <fixed facet=\"" ); //$NON-NLS-1$
-            out.print( escape( f.getId() ) );
+            out.print( escape( fid ) );
             out.print( "\"/>" ); //$NON-NLS-1$
             out.print( nl );
         }
         
         for( IProjectFacetVersion fv : this.facets )
         {
+            final IProjectFacet f = fv.getProjectFacet();
+
+            String fid = this.activeFacetAliases.get( f );
+            fid = ( fid == null ? f.getId() : fid );
+            
+            String fverstr = this.activeFacetVersionAliases.get( fv );
+            fverstr = ( fverstr == null ? fv.getVersionString() : fverstr );
+            
             out.print( "  <installed facet=\"" ); //$NON-NLS-1$
-            out.print( escape( fv.getProjectFacet().getId() ) );
+            out.print( escape( fid ) );
             out.print( "\" version=\"" ); //$NON-NLS-1$
-            out.print( escape( fv.getVersionString() ) );
+            out.print( escape( fverstr ) );
             out.print( "\"/>" ); //$NON-NLS-1$
             out.print( nl );
         }
@@ -1585,6 +1600,8 @@
                 this.facets.clear();
                 this.fixed.clear();
                 this.unknownFacets.clear();
+                this.activeFacetAliases.clear();
+                this.activeFacetVersionAliases.clear();
                 this.targetedRuntimes.clear();
                 this.primaryRuntime = null;
                 
@@ -1634,6 +1651,11 @@
                                 if( ProjectFacetsManager.isProjectFacetDefined( id ) )
                                 {
                                     f = ProjectFacetsManager.getProjectFacet( id );
+                                    
+                                    if( ! f.getId().equals( id ) )
+                                    {
+                                        this.activeFacetAliases.put( f, id );
+                                    }
                                 }
                                 else
                                 {
@@ -1652,6 +1674,11 @@
                                 if( ProjectFacetsManager.isProjectFacetDefined( id ) )
                                 {
                                     f = ProjectFacetsManager.getProjectFacet( id );
+                                    
+                                    if( ! f.getId().equals( id ) )
+                                    {
+                                        this.activeFacetAliases.put( f, id );
+                                    }
                                 }
                                 else
                                 {
@@ -1663,6 +1690,11 @@
                                 if( f.hasVersion( version ) )
                                 {
                                     fv = f.getVersion( version );
+                                    
+                                    if( ! fv.getVersionString().equals( version ) )
+                                    {
+                                        this.activeFacetVersionAliases.put( fv, version );
+                                    }
                                 }
                                 else
                                 {
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectFrameworkImpl.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectFrameworkImpl.java
index 99510d1..b3f3724 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectFrameworkImpl.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectFrameworkImpl.java
@@ -65,6 +65,7 @@
 import org.eclipse.wst.common.project.facet.core.IProjectFacet;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.common.project.facet.core.IVersionExpr;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
 import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
 import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
 import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectFrameworkEvent;
@@ -212,7 +213,7 @@
     
     public Set<IProjectFacet> getProjectFacets()
     {
-        return this.facets.getUnmodifiable();
+        return this.facets.getItemSet();
     }
     
     public boolean isProjectFacetDefined( final String id )
@@ -222,7 +223,7 @@
     
     public IProjectFacet getProjectFacet( final String id )
     {
-        final IProjectFacet f = this.facets.get( id );
+        final IProjectFacet f = this.facets.getItemByKey( id );
         
         if( f == null )
         {
@@ -235,7 +236,7 @@
     
     public Set<IActionDefinition> getActionDefinitions()
     {
-        return this.actions.getUnmodifiable();
+        return this.actions.getItemSet();
     }
     
     public boolean isActionDefined( final String id )
@@ -245,7 +246,7 @@
     
     public IActionDefinition getActionDefinition( final String id )
     {
-        final IActionDefinition adef = this.actions.get( id );
+        final IActionDefinition adef = this.actions.getItemByKey( id );
         
         if( adef == null )
         {
@@ -258,7 +259,7 @@
     
     public Set<ICategory> getCategories()
     {
-        return this.categories.getUnmodifiable();
+        return this.categories.getItemSet();
     }
 
     public boolean isCategoryDefined( final String id )
@@ -268,7 +269,7 @@
     
     public ICategory getCategory( final String id )
     {
-        final ICategory category = this.categories.get( id );
+        final ICategory category = this.categories.getItemByKey( id );
         
         if( category == null )
         {
@@ -284,7 +285,7 @@
         synchronized( this.presets )
         {
             initializePresets();
-            return this.presets.getUnmodifiable();
+            return this.presets.getItemSet();
         }
     }
     
@@ -303,7 +304,7 @@
         {
             initializePresets();
             
-            final IPreset preset = this.presets.get( id );
+            final IPreset preset = this.presets.getItemByKey( id );
             
             if( preset == null )
             {
@@ -358,7 +359,7 @@
                 = new UserPreset( id, name, description == null ? "" : description,  //$NON-NLS-1$
                                   facets );
             
-            this.presets.add( id, preset );
+            this.presets.addItemWithKey( id, preset );
             
             if( save )
             {
@@ -382,7 +383,7 @@
                 return false;
             }
             
-            deleted = this.presets.delete( preset.getId() );
+            deleted = this.presets.removeItemByKey( preset.getId() );
             
             if( deleted )
             {
@@ -409,7 +410,7 @@
             {
                 for( IPreset preset : PresetsExtensionPoint.getPresets() )
                 {
-                    this.presets.add( preset.getId(), preset );
+                    this.presets.addItemWithKey( preset.getId(), preset );
                 }
                 
                 readUserPresets();
@@ -432,7 +433,7 @@
                 root.node( children[ i ] ).removeNode();
             }
             
-            for( IPreset preset : this.presets )
+            for( IPreset preset : this.presets.getItemSet() )
             {
                 if( preset.getType() == IPreset.Type.USER_DEFINED )
                 {
@@ -570,7 +571,7 @@
     
     public Set<IGroup> getGroups()
     {
-        return this.groups.getUnmodifiable();
+        return this.groups.getItemSet();
     }
     
     public boolean isGroupDefined( final String id )
@@ -580,7 +581,7 @@
     
     public IGroup getGroup( final String id )
     {
-        final IGroup group = this.groups.get( id );
+        final IGroup group = this.groups.getItemByKey( id );
         
         if( group == null )
         {
@@ -1445,7 +1446,7 @@
         final IConfigurationElement elDesc = findOptionalElement( config, EL_DESCRIPTION );
         category.setDescription( getElementValue( elDesc, DEFAULT_DESCRIPTION ) );
         
-        this.categories.add( category.getId(), category );
+        this.categories.addItemWithKey( category.getId(), category );
     }
     
     private void readProjectFacet( final IConfigurationElement config )
@@ -1544,7 +1545,14 @@
             }
         }
         
-        this.facets.add( f.getId(), f );
+        this.facets.addItem( f );
+        this.facets.addKey( f.getId(), f );
+        
+        for( String alias : ProjectFacetAliasesExtensionPoint.getAliases( f ) )
+        {
+            this.facets.addKey( alias, f );
+            f.addAlias( alias );
+        }
     }
     
     private void readProjectFacetVersion( final IConfigurationElement config,
@@ -1567,7 +1575,7 @@
             return;
         }
         
-        final ProjectFacet f = (ProjectFacet) this.facets.get( fid );
+        final ProjectFacet f = (ProjectFacet) this.facets.getItemByKey( fid );
         
         if( f == null )
         {
@@ -1606,14 +1614,14 @@
                     return;
                 }
                 
-                Group group = (Group) this.groups.get( id );
+                Group group = (Group) this.groups.getItemByKey( id );
                 
                 if( group == null )
                 {
                     group = new Group();
                     group.setId( id );
                     
-                    this.groups.add( id, group );
+                    this.groups.addItemWithKey( id, group );
                 }
                 
                 group.addMember( fv );
@@ -1672,7 +1680,7 @@
     {
         final List<IProjectFacet> badFacets = new ArrayList<IProjectFacet>();
         
-        for( IProjectFacet f : this.facets )
+        for( IProjectFacet f : this.facets.getItemSet() )
         {
             try
             {
@@ -1730,7 +1738,7 @@
         
         for( IProjectFacet f : badFacets )
         {
-            this.facets.remove( f );
+            this.facets.removeItem( f );
             
             final Category category = (Category) f.getCategory();
             
@@ -1835,7 +1843,7 @@
             return;
         }
         
-        final ProjectFacet f = (ProjectFacet) this.facets.get( fid );
+        final ProjectFacet f = (ProjectFacet) this.facets.getItemByKey( fid );
         
         if( f == null )
         {
@@ -2011,7 +2019,7 @@
         }
         else
         {
-            this.actions.add( def.getId(), def );
+            this.actions.addItemWithKey( def.getId(), def );
             f.addActionDefinition( def );
         }
     }
@@ -2026,7 +2034,7 @@
             return;
         }
         
-        final ProjectFacet f = (ProjectFacet) this.facets.get( fid );
+        final ProjectFacet f = (ProjectFacet) this.facets.getItemByKey( fid );
         
         if( f == null )
         {
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectTemplatesExtensionPoint.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectTemplatesExtensionPoint.java
index a2f7625..85f4286 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectTemplatesExtensionPoint.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectTemplatesExtensionPoint.java
@@ -51,13 +51,13 @@
     public static Set<IFacetedProjectTemplate> getTemplates()
     {
         readExtensions();
-        return templates.getUnmodifiable();
+        return templates.getItemSet();
     }
     
     public static IFacetedProjectTemplate getTemplate( final String id )
     {
         readExtensions();
-        return templates.get( id );
+        return templates.getItemByKey( id );
     }
     
     private static synchronized void readExtensions()
@@ -136,7 +136,7 @@
             }
         }
         
-        templates.add( template.getId(), template );
+        templates.addItemWithKey( template.getId(), template );
     }
     
     private static final class Resources
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectWorkingCopy.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectWorkingCopy.java
index 22faeb8..e0c5b2c 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectWorkingCopy.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProjectWorkingCopy.java
@@ -640,7 +640,7 @@
     {
         synchronized( this.lock )
         {
-            return this.facets.getUnmodifiable();
+            return this.facets.getItemSet();
         }
     }
     
@@ -648,7 +648,7 @@
     {
         synchronized( this.lock )
         {
-            return this.facets.get( f );
+            return this.facets.getItemByKey( f );
         }
     }
     
@@ -664,7 +664,7 @@
     {
         synchronized( this.lock )
         {
-            return this.facets.contains( fv );
+            return this.facets.containsItem( fv );
         }
     }
     
@@ -681,17 +681,17 @@
                 
                 for( IProjectFacetVersion fv : facets )
                 {
-                    newProjectFacets.add( fv.getProjectFacet(), fv );
+                    newProjectFacets.addItemWithKey( fv.getProjectFacet(), fv );
                 }
                 
                 final Set<IProjectFacetVersion> addedFacets = new HashSet<IProjectFacetVersion>();
                 final Set<IProjectFacetVersion> removedFacets = new HashSet<IProjectFacetVersion>();
                 final Set<IProjectFacetVersion> changedVersions = new HashSet<IProjectFacetVersion>();
                 
-                for( IProjectFacetVersion fv : newProjectFacets )
+                for( IProjectFacetVersion fv : newProjectFacets.getItemSet() )
                 {
                     final IProjectFacetVersion currentFacetVersion 
-                        = this.facets.get( fv.getProjectFacet() );
+                        = this.facets.getItemByKey( fv.getProjectFacet() );
                     
                     if( currentFacetVersion == null )
                     {
@@ -706,7 +706,7 @@
                     }
                 }
                 
-                for( IProjectFacetVersion fv : this.facets )
+                for( IProjectFacetVersion fv : this.facets.getItemSet() )
                 {
                     if( ! newProjectFacets.containsKey( fv.getProjectFacet() ) )
                     {
@@ -752,14 +752,14 @@
             synchronized( this.lock )
             {
                 final IProjectFacetVersion existingVersion 
-                    = this.facets.get( fv.getProjectFacet() );
+                    = this.facets.getItemByKey( fv.getProjectFacet() );
                 
                 if( existingVersion == null )
                 {
                     final Set<IProjectFacetVersion> newProjectFacets 
                         = new HashSet<IProjectFacetVersion>();
         
-                    newProjectFacets.addAll( this.facets );
+                    newProjectFacets.addAll( this.facets.getItemSet() );
                     newProjectFacets.add( fv );
                     
                     setProjectFacets( newProjectFacets );
@@ -812,7 +812,7 @@
             synchronized( this.lock )
             {
                 final IProjectFacetVersion existingVersion 
-                    = this.facets.get( fv.getProjectFacet() );
+                    = this.facets.getItemByKey( fv.getProjectFacet() );
                 
                 if( existingVersion == null )
                 {
@@ -823,7 +823,7 @@
                     final Set<IProjectFacetVersion> newProjectFacets 
                         = new HashSet<IProjectFacetVersion>();
         
-                    newProjectFacets.addAll( this.facets );
+                    newProjectFacets.addAll( this.facets.getItemSet() );
                     newProjectFacets.remove( fv );
                     
                     setProjectFacets( newProjectFacets );
@@ -850,7 +850,7 @@
             synchronized( this.lock )
             {
                 final IProjectFacetVersion existingVersion 
-                    = this.facets.get( fv.getProjectFacet() );
+                    = this.facets.getItemByKey( fv.getProjectFacet() );
                 
                 if( existingVersion == null )
                 {
@@ -866,7 +866,7 @@
                     final Set<IProjectFacetVersion> newProjectFacets 
                         = new HashSet<IProjectFacetVersion>();
         
-                    newProjectFacets.addAll( this.facets );
+                    newProjectFacets.addAll( this.facets.getItemSet() );
                     newProjectFacets.remove( existingVersion );
                     newProjectFacets.add( fv );
                     
@@ -896,7 +896,7 @@
     {
         synchronized( this.lock )
         {
-            return this.availablePresets.getUnmodifiable();
+            return this.availablePresets.getItemSet();
         }
     }
     
@@ -974,7 +974,7 @@
                     
                     if( applicable )
                     {
-                        newAvailablePresets.add( preset.getId(), preset );
+                        newAvailablePresets.addItemWithKey( preset.getId(), preset );
                     }
                 }
                 
@@ -1003,7 +1003,7 @@
         {
             if( this.selectedPresetId != null )
             {
-                return this.availablePresets.get( this.selectedPresetId );
+                return this.availablePresets.getItemByKey( this.selectedPresetId );
             }
             else
             {
@@ -1026,7 +1026,7 @@
                     throw new IllegalArgumentException( msg );
                 }
                 
-                final IPreset preset = this.availablePresets.get( presetId );
+                final IPreset preset = this.availablePresets.getItemByKey( presetId );
                 
                 if( ! equals( this.selectedPresetId, presetId ) || 
                     ( preset != null && ! equals( preset.getProjectFacets(), getProjectFacets() ) ) )
@@ -1060,7 +1060,7 @@
     {
         synchronized( this.lock )
         {
-            return this.availablePresets.get( DefaultConfigurationPresetFactory.PRESET_ID );
+            return this.availablePresets.getItemByKey( DefaultConfigurationPresetFactory.PRESET_ID );
         }
     }
 
@@ -1068,7 +1068,7 @@
     {
         synchronized( this.lock )
         {
-            return this.availablePresets.get( MinimalConfigurationPresetFactory.PRESET_ID );
+            return this.availablePresets.getItemByKey( MinimalConfigurationPresetFactory.PRESET_ID );
         }
     }
 
@@ -1111,7 +1111,7 @@
                     {
                         ok = true;
                         
-                        for( IProjectFacetVersion fv : this.facets )
+                        for( IProjectFacetVersion fv : this.facets.getItemSet() )
                         {
                             if( ! r.supports( fv ) )
                             {
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/PresetsExtensionPoint.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/PresetsExtensionPoint.java
index 31c42ce..bb7727c 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/PresetsExtensionPoint.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/PresetsExtensionPoint.java
@@ -71,13 +71,13 @@
     public static Set<IPreset> getPresets()
     {
         readExtensions();
-        return presets.getUnmodifiable();
+        return presets.getItemSet();
     }
     
     public static IPreset getPreset( final String id )
     {
         readExtensions();
-        return presets.get( id );
+        return presets.getItemByKey( id );
     }
     
     private static synchronized void readExtensions()
@@ -137,11 +137,11 @@
         // Resolve the base presets. Make sure that no presets are extending presets that do not
         // exist, check for circular references, etc.
         
-        Set<IPreset> copy = new HashSet<IPreset>( presets ); 
+        Set<IPreset> copy = new HashSet<IPreset>( presets.getItemSet() ); 
         
         for( IPreset preset : copy )
         {
-            if( presets.contains( preset ) )
+            if( presets.containsItem( preset ) )
             {
                 resolveBasePreset( preset, new HashSet<IPreset>() );
             }
@@ -156,7 +156,7 @@
         {
             doAnotherPass = false;
             
-            for( IPreset preset : presets )
+            for( IPreset preset : presets.getItemSet() )
             {
                 if( preset.getType() == IPreset.Type.STATIC )
                 {
@@ -177,7 +177,8 @@
                                                                     stPreset.getBasePresetId(),
                                                                     stPreset.getProjectFacets() );
                             
-                            presets.add( stPresetNew.getId(), stPresetNew );
+                            presets.removeItem( stPreset );
+                            presets.addItemWithKey( stPresetNew.getId(), stPresetNew );
 
                             doAnotherPass = true;
                             break;
@@ -257,7 +258,7 @@
         final StaticPreset preset 
             = new StaticPreset( id, pluginId, label, description, basePreset, facets );
         
-        presets.add( id, preset );
+        presets.addItemWithKey( id, preset );
     }
 
     private static void readDynamicPreset( final IConfigurationElement el )
@@ -271,7 +272,7 @@
         final String factoryClassName = findRequiredAttribute( elFactory, ATTR_CLASS );
         
         final DynamicPreset preset = new DynamicPreset( id, pluginId, factoryClassName );
-        presets.add( id, preset );
+        presets.addItemWithKey( id, preset );
     }
     
     private static boolean resolveBasePreset( final IPreset preset,
@@ -339,7 +340,7 @@
 
                 if( problem )
                 {
-                    PresetsExtensionPoint.presets.delete( preset.getId() );
+                    PresetsExtensionPoint.presets.removeItemByKey( preset.getId() );
                     return false;
                 }
             }
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java
index 2ddc8ea..7730997 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java
@@ -44,6 +44,8 @@
     
 {
     private String id;
+    private final Set<String> aliases;
+    private final Set<String> aliasesReadOnly;
     private String plugin;
     private String label;
     private String description;
@@ -56,6 +58,8 @@
     
     ProjectFacet() 
     {
+        this.aliases = new HashSet<String>();
+        this.aliasesReadOnly = Collections.unmodifiableSet( this.aliases );
         this.actionDefinitions = new ArrayList<IActionDefinition>();
         this.properties = new HashMap<String,Object>();
         this.propertiesReadOnly = Collections.unmodifiableMap( this.properties );
@@ -71,6 +75,16 @@
         this.id = id;
     }
     
+    public Set<String> getAliases()
+    {
+        return this.aliasesReadOnly;
+    }
+    
+    void addAlias( final String alias )
+    {
+        this.aliases.add( alias );
+    }
+    
     public String getPluginId()
     {
         return this.plugin;
@@ -111,9 +125,16 @@
         this.category = category;
     }
     
-    void addVersion( final IProjectFacetVersion ver )
+    void addVersion( final IProjectFacetVersion fv )
     {
-        this.versions.add( ver.getVersionString(), ver );
+        this.versions.addItem( fv );
+        this.versions.addKey( fv.getVersionString(), fv );
+        
+        for( String alias : ProjectFacetAliasesExtensionPoint.getAliases( fv ) )
+        {
+            this.versions.addKey( alias, fv );
+            ( (ProjectFacetVersion) fv ).addAlias( alias );
+        }
     }
     
     public IProjectFacetVersion getLatestSupportedVersion( final IRuntime r )
@@ -212,7 +233,7 @@
     
     public boolean isVersionHidden()
     {
-        return ( this.versions.size() == 1 &&
+        return ( this.versions.getItemSet().size() == 1 &&
                  equal( getProperty( PROP_HIDE_VERSION ), true ) );
     }
     
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetAliasesExtensionPoint.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetAliasesExtensionPoint.java
new file mode 100644
index 0000000..d56791d
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetAliasesExtensionPoint.java
@@ -0,0 +1,154 @@
+/******************************************************************************
+ * Copyright (c) 2010 Oracle
+ * 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
+ *
+ * Contributors:
+ *    Konstantin Komissarchik - initial implementation and ongoing maintenance
+ ******************************************************************************/
+
+package org.eclipse.wst.common.project.facet.core.internal;
+
+import static org.eclipse.wst.common.project.facet.core.internal.FacetCorePlugin.PLUGIN_ID;
+import static org.eclipse.wst.common.project.facet.core.util.internal.PluginUtil.findExtensions;
+import static org.eclipse.wst.common.project.facet.core.util.internal.PluginUtil.findRequiredAttribute;
+import static org.eclipse.wst.common.project.facet.core.util.internal.PluginUtil.getTopLevelElements;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.util.internal.PluginUtil.InvalidExtensionException;
+
+/**
+ * Contains the logic for processing the <code>aliases</code> extension point. 
+ * 
+ * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
+ */
+
+public final class ProjectFacetAliasesExtensionPoint
+{
+    public static final String EXTENSION_POINT_ID = "aliases"; //$NON-NLS-1$
+    
+    private static final String EL_FACET_ALIAS = "facet-alias"; //$NON-NLS-1$
+    private static final String EL_FACET_VERSION_ALIAS = "facet-version-alias"; //$NON-NLS-1$
+    private static final String ATTR_ALIAS = "alias"; //$NON-NLS-1$
+    private static final String ATTR_FACET = "facet"; //$NON-NLS-1$
+    private static final String ATTR_VERSION = "version"; //$NON-NLS-1$
+    
+    /*
+     * Note that the facetAliases and facetVersionAliases data structures hold strings rather
+     * than more specific IProjectFacet and IProjectFacetVersion objects. This is done this
+     * way as this class is called during initialization of FacetedProjectFramework and we need
+     * to avoid circular calls (this class cannot call back to FacetedProjectFramework).
+     */
+    
+    private static Map<String,Set<String>> facetAliases = null;
+    private static Map<String,Map<String,Set<String>>> facetVersionAliases = null;
+    
+    public static Set<String> getAliases( final IProjectFacet f )
+    {
+        readExtensions();
+        
+        final Set<String> aliases = facetAliases.get( f.getId() );
+        
+        if( aliases != null )
+        {
+            return aliases; 
+        }
+        
+        return Collections.emptySet();
+    }
+    
+    public static Set<String> getAliases( final IProjectFacetVersion fv )
+    {
+        readExtensions();
+        
+        final Map<String,Set<String>> versionToAliasesMap = facetVersionAliases.get( fv.getProjectFacet().getId() );
+        
+        if( versionToAliasesMap != null )
+        {
+            final Set<String> aliases = versionToAliasesMap.get( fv.getVersionString() );
+            
+            if( aliases != null )
+            {
+                return aliases;
+            }
+        }
+        
+        return Collections.emptySet();
+    }
+    
+    private static synchronized void readExtensions()
+    {
+        if( facetAliases != null )
+        {
+            return;
+        }
+        
+        facetAliases = new HashMap<String,Set<String>>();
+        facetVersionAliases = new HashMap<String,Map<String,Set<String>>>();
+        
+        for( IConfigurationElement element 
+             : getTopLevelElements( findExtensions( PLUGIN_ID, EXTENSION_POINT_ID ) ) )
+        {
+            final String elname = element.getName();
+            
+            try
+            {
+                if( elname.equals( EL_FACET_ALIAS ) || elname.equals( EL_FACET_VERSION_ALIAS ) )
+                {
+                    final String fid = findRequiredAttribute( element, ATTR_FACET );
+                    final String alias = findRequiredAttribute( element, ATTR_ALIAS );
+
+                    if( elname.equals( EL_FACET_ALIAS ) )
+                    {
+                        Set<String> aliases = facetAliases.get( fid );
+                        
+                        if( aliases == null )
+                        {
+                            aliases = new HashSet<String>();
+                            facetAliases.put( fid, aliases );
+                        }
+                        
+                        aliases.add( alias );
+                    }
+                    else
+                    {
+                        final String fvstr = findRequiredAttribute( element, ATTR_VERSION );
+                        
+                        Map<String,Set<String>> versionToAliasesMap = facetVersionAliases.get( fid );
+                        
+                        if( versionToAliasesMap == null )
+                        {
+                            versionToAliasesMap = new HashMap<String,Set<String>>();
+                            facetVersionAliases.put( fid, versionToAliasesMap );
+                        }
+                        
+                        Set<String> aliases = versionToAliasesMap.get( fvstr );
+                        
+                        if( aliases == null )
+                        {
+                            aliases = new HashSet<String>();
+                            versionToAliasesMap.put( fvstr, aliases );
+                        }
+                        
+                        aliases.add( alias );
+                    }
+                }
+            }
+            catch( InvalidExtensionException e )
+            {
+                // Continue. The problem has been reported to the user via the log.
+            }
+        }
+    }
+    
+}
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java
index c4bc352..e3d6085 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java
@@ -43,6 +43,8 @@
 {
     private ProjectFacet facet;
     private String version;
+    private final Set<String> aliases;
+    private final Set<String> aliasesReadOnly;
     private IConstraint constraint;
     private String plugin;
     private Map<IProjectFacetVersion,Integer> compTable = Collections.emptyMap();
@@ -51,6 +53,8 @@
     
     ProjectFacetVersion() 
     {
+        this.aliases = new HashSet<String>();
+        this.aliasesReadOnly = Collections.unmodifiableSet( this.aliases );
         this.properties = new HashMap<String,Object>();
         this.propertiesReadOnly = Collections.unmodifiableMap( this.properties );
     }
@@ -75,6 +79,16 @@
         this.version = version;
     }
     
+    public Set<String> getAliases()
+    {
+        return this.aliasesReadOnly;
+    }
+    
+    void addAlias( final String alias )
+    {
+        this.aliases.add( alias );
+    }
+    
     public Versionable<IProjectFacetVersion> getVersionable()
     {
         return this.facet;
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeComponentType.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeComponentType.java
index b9404a8..a0a2bb7 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeComponentType.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeComponentType.java
@@ -52,7 +52,7 @@
     
     void addVersion( final IRuntimeComponentVersion ver )
     {
-        this.versions.add( ver.getVersionString(), ver );
+        this.versions.addItemWithKey( ver.getVersionString(), ver );
     }
     
     @SuppressWarnings( "unchecked" )
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeManagerImpl.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeManagerImpl.java
index 7b1007b..73fef92 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeManagerImpl.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/runtime/internal/RuntimeManagerImpl.java
@@ -108,7 +108,7 @@
     
     public static Set<IRuntimeComponentType> getRuntimeComponentTypes()
     {
-        return runtimeComponentTypes.getUnmodifiable();
+        return runtimeComponentTypes.getItemSet();
     }
     
     public static boolean isRuntimeComponentTypeDefined( final String id )
@@ -118,7 +118,7 @@
     
     public static IRuntimeComponentType getRuntimeComponentType( final String id )
     {
-        final IRuntimeComponentType rc = runtimeComponentTypes.get( id );
+        final IRuntimeComponentType rc = runtimeComponentTypes.getItemByKey( id );
         
         if( rc == null )
         {
@@ -154,7 +154,7 @@
         synchronized( runtimes )
         {
             bridge();
-            return new HashSet<IRuntime>( runtimes );
+            return new HashSet<IRuntime>( runtimes.getItemSet() );
         }
     }
     
@@ -166,7 +166,7 @@
             
             final Set<IRuntime> result = new HashSet<IRuntime>();
             
-            for( IRuntime r : runtimes )
+            for( IRuntime r : runtimes.getItemSet() )
             {
                 boolean supports = true;
                 
@@ -204,7 +204,7 @@
         {
             bridge();
             
-            final IRuntime runtime = runtimes.get( name );
+            final IRuntime runtime = runtimes.getItemByKey( name );
             
             if( runtime == null )
             {
@@ -239,7 +239,7 @@
                 }
             }
             
-            runtimes.add( r.getName(), r );
+            runtimes.addItemWithKey( r.getName(), r );
             
             notifyRuntimeListeners();
             
@@ -251,7 +251,7 @@
     {
         synchronized( runtimes )
         {
-            if( runtimes.delete( runtime.getName() ) )
+            if( runtimes.removeItemByKey( runtime.getName() ) )
             {
                 notifyRuntimeListeners();
             }
@@ -362,7 +362,7 @@
             
             final Map<String,BridgedRuntime> existing = new HashMap<String,BridgedRuntime>();
             
-            for( IRuntime r : runtimes )
+            for( IRuntime r : runtimes.getItemSet() )
             {
                 if( r instanceof BridgedRuntime )
                 {
@@ -389,7 +389,7 @@
                 
                 for( BridgedRuntime r : existing.values() )
                 {
-                    runtimes.remove( r.getName() );
+                    runtimes.removeItemByKey( r.getName() );
                     modified = true;
                 }
                 
@@ -402,7 +402,7 @@
             {
                 if( ! exported.contains( r.getNativeRuntimeId() ) )
                 {
-                    runtimes.delete( r.getName() );
+                    runtimes.removeItemByKey( r.getName() );
                     modified = true;
                 }
             }
@@ -422,7 +422,7 @@
                         
                         r.setName( createUniqueRuntimeName( id ) );
                         
-                        runtimes.add( r.getName(), r );
+                        runtimes.addItemWithKey( r.getName(), r );
                         modified = true;
                     }
                     catch( CoreException e )
@@ -443,7 +443,7 @@
     {
         String name = suggestion;
         
-        for( int i = 1; runtimes.contains( name ); i++ )
+        for( int i = 1; runtimes.containsKey( name ); i++ )
         {
             name = suggestion + " (" + i + ")"; //$NON-NLS-1$ //$NON-NLS-2$
         }
@@ -544,7 +544,7 @@
             }
         }
         
-        runtimeComponentTypes.add( id, rct );
+        runtimeComponentTypes.addItemWithKey( id, rct );
     }
     
     private static void readRuntimeComponentVersion( final IConfigurationElement config )
@@ -566,7 +566,7 @@
         }
         
         final RuntimeComponentType rct 
-            = (RuntimeComponentType) runtimeComponentTypes.get( type );
+            = (RuntimeComponentType) runtimeComponentTypes.getItemByKey( type );
         
         if( rct == null )
         {
@@ -601,7 +601,7 @@
         final List<IRuntimeComponentType> badRuntimeComponentTypes 
             = new ArrayList<IRuntimeComponentType>();
         
-        for( IRuntimeComponentType rct : runtimeComponentTypes )
+        for( IRuntimeComponentType rct : runtimeComponentTypes.getItemSet() )
         {
             try
             {
@@ -660,7 +660,7 @@
         
         for( IRuntimeComponentType rct : badRuntimeComponentTypes )
         {
-            runtimeComponentTypes.remove( rct );
+            runtimeComponentTypes.removeItem( rct );
         }
     }
     
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java
index a2f68f3..e0ac9d8 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java
@@ -1,5 +1,5 @@
 /******************************************************************************
- * Copyright (c) 2008 BEA Systems, Inc.
+ * Copyright (c) 2010 Oracle
  * 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
@@ -14,53 +14,33 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
 /**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
+ * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
  */
 
 public final class IndexedSet<K,V>
-
-    extends HashSet<V>
-    
 {
-    private static final long serialVersionUID = 1L;
+    private final Set<V> set;
     private final Set<V> unmodifiable;
     private final Map<K,V> index;
     
     public IndexedSet()
     {
-        this.unmodifiable = Collections.unmodifiableSet( this );
+        this.set = new HashSet<V>();
+        this.unmodifiable = Collections.unmodifiableSet( this.set );
         this.index = new HashMap<K,V>();
     }
     
-    public void add( final K key,
-                     final V value )
+    public Set<V> getItemSet()
     {
-        remove( this.index.get( key ) );
-        add( value );
-        this.index.put( key, value );
+        return this.unmodifiable;
     }
-    
-    public boolean delete( final K key )
-    {
-        final Object value = this.index.get( key );
-        
-        if( value == null )
-        {
-            return false;
-        }
-        else
-        {
-            remove( value );
-            this.index.remove( key );
-            return true;
-        }
-    }
-    
-    public V get( final K key )
+
+    public V getItemByKey( final K key )
     {
         return this.index.get( key );
     }
@@ -69,9 +49,75 @@
     {
         return this.index.containsKey( key );
     }
-    
-    public Set<V> getUnmodifiable()
+
+    public boolean containsItem( final V item )
     {
-        return this.unmodifiable;
+        return this.set.contains( item );
     }
+
+    public void addItem( final V item )
+    {
+        if( item == null )
+        {
+            throw new IllegalArgumentException();
+        }
+        
+        this.set.add( item );
+    }
+    
+    public void addItemWithKey( final K key,
+                                final V item )
+    {
+        addItem( item );
+        addKey( key, item );
+    }
+    
+    public void addKey( final K key,
+                        final V item )
+    {
+        if( key == null || item == null )
+        {
+            throw new IllegalArgumentException();
+        }
+        
+        if( ! this.set.contains( item ) )
+        {
+            throw new IllegalArgumentException();
+        }
+        
+        this.index.put( key, item );
+    }
+    
+    public boolean removeItem( final V item )
+    {
+        if( this.set.remove( item ) )
+        {
+            for( Iterator<Map.Entry<K,V>> itr = this.index.entrySet().iterator(); itr.hasNext(); )
+            {
+                final Map.Entry<K,V> entry = itr.next();
+                
+                if( entry.getValue() == item )
+                {
+                    itr.remove();
+                }
+            }
+        
+            return true;
+        }
+        
+        return false;
+    }
+
+    public boolean removeItemByKey( final K key )
+    {
+        final V item = this.index.get( key );
+        
+        if( item != null )
+        {
+            return removeItem( item );
+        }
+        
+        return false;
+    }
+    
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java
index 54b47da..cba6510 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java
@@ -49,7 +49,7 @@
     
     public Set<T> getVersions()
     {
-        return this.versions.getUnmodifiable();
+        return this.versions.getItemSet();
     }
     
     public Set<T> getVersions( final String expr )
@@ -60,7 +60,7 @@
         final VersionExpr<T> prepared = new VersionExpr<T>( this, expr, null );
         final Set<T> result = new HashSet<T>();
          
-        for( T ver : this.versions )
+        for( T ver : this.versions.getItemSet() )
         {
             if( prepared.check( ver ) )
             {
@@ -73,7 +73,7 @@
     
     public T getVersion( final String version )
     {
-        final T ver = this.versions.get( version );
+        final T ver = this.versions.getItemByKey( version );
         
         if( ver == null )
         {
@@ -87,9 +87,9 @@
     
     public T getLatestVersion()
     {
-        if( this.versions.size() > 0 )
+        if( this.versions.getItemSet().size() > 0 )
         {
-            return (T) Collections.max( this.versions );
+            return Collections.max( this.versions.getItemSet() );
         }
         else
         {
@@ -123,7 +123,7 @@
             };
         }
 
-        final List<T> list = new ArrayList<T>( this.versions );
+        final List<T> list = new ArrayList<T>( this.versions.getItemSet() );
         Collections.sort( list, comp );
         
         return list;