package com.codeaffine.eclipse.core.runtime;

import static com.codeaffine.eclipse.core.runtime.ArgumentVerification.verifyNotNull;
import static java.util.Arrays.asList;

import java.util.ArrayList;
import java.util.Collection;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;

public class Extension {

  private final IConfigurationElement element;

  public Extension( IConfigurationElement element ) {
    this.element = element;
  }

  public IConfigurationElement getConfigurationElement() {
    return element;
  }

  public String getAttribute( String name ) {
    return element.getAttribute( name );
  }

  public String getAttribute( String name, String locale ) {
    return element.getAttribute( name, locale );
  }

  public Collection<String> getAttributeNames() {
    return asList( element.getAttributeNames() );
  }

  public String getName() {
    return element.getName();
  }

  public <T> T createExecutableExtension( Class <T> type ) throws ExtensionException {
    return createExecutableExtension( "class", type );
  }

  public <T> T createExecutableExtension( String typeAttribute, Class <T> type ) throws ExtensionException {
    verifyNotNull( typeAttribute, "typeAttribute" );
    verifyNotNull( type, "type" );

    try {
      return type.cast( element.createExecutableExtension( typeAttribute ) );
    } catch( CoreException ce ) {
      throw new ExtensionException( ce );
    }
  }

  public String getValue() {
    return element.getValue();
  }

  public String getValue( String locale ) {
    return element.getValue( locale );
  }

  public Collection<Extension> getChildren() {
    Collection<Extension> result = new ArrayList<Extension>();
    for( IConfigurationElement child : element.getChildren() ) {
      result.add( new Extension( child ) );
    }
    return result;
  }

  public Collection<Extension> getChildren( String name ) {
    Collection<Extension> result = new ArrayList<Extension>();
    for( IConfigurationElement child : element.getChildren() ) {
      if( child.getName().equals( name ) ) {
        result.add( new Extension( child ) );
      }
    }
    return result;
  }
}
@@ -210,26 +210,20 @@
 va.util.
-Collection
+List
 ;%0A%0Aimpor
@@ -781,26 +781,20 @@
  public 
-Collection
+List
 %3CString%3E
@@ -1612,34 +1612,28 @@
 %7D%0A%0A  public 
-Collection
+List
 %3CExtension%3E 
@@ -1648,34 +1648,28 @@
 ren() %7B%0A    
-Collection
+List
 %3CExtension%3E 
@@ -1853,26 +1853,20 @@
  public 
-Collection
+List
 %3CExtensi
@@ -1906,18 +1906,12 @@
     
-Collection
+List
 %3CExt

Change return type of various methods from Collection to List