### Eclipse Workspace Patch 1.0 #P org.eclipse.team.ui Index: src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java,v retrieving revision 1.13 diff -u -r1.13 TeamContentProviderDescriptor.java --- src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java 16 Mar 2007 21:03:35 -0000 1.13 +++ src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java 28 Nov 2008 09:48:06 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 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 @@ -55,29 +55,37 @@ * Initialize this descriptor based on the provided extension point. */ protected void readExtension(IExtension extension) throws CoreException { - //read the extension + // read the extension String id = extension.getUniqueIdentifier(); // id not required IConfigurationElement[] elements = extension.getConfigurationElements(); - int count = elements.length; - for (int i = 0; i < count; i++) { - IConfigurationElement element = elements[i]; - configElement = element; + + // there has to be exactly one team content provider element + // in the provided extension (see teamContentProviders.exsd) + if (elements.length > 0) { + IConfigurationElement element = elements[0]; String name = element.getName(); if (name.equalsIgnoreCase(TAG_TEAM_CONTENT_PROVIDER)) { + configElement = element; modelProviderId = element.getAttribute(ATT_MODEL_PROVIDER_ID); - contentExtensionId = element.getAttribute(ATT_CONTENT_EXTENSION_ID); - String supportsFlatLayoutString = element.getAttribute(ATT_SUPPORTS_FLAT_LAYOUT); + contentExtensionId = element + .getAttribute(ATT_CONTENT_EXTENSION_ID); + String supportsFlatLayoutString = element + .getAttribute(ATT_SUPPORTS_FLAT_LAYOUT); if (supportsFlatLayoutString != null) { - supportsFlatLayout = Boolean.valueOf(supportsFlatLayoutString).booleanValue(); + supportsFlatLayout = Boolean.valueOf( + supportsFlatLayoutString).booleanValue(); } contentProviderName = extension.getLabel(); } - break; } if (modelProviderId == null) - fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { ATT_MODEL_PROVIDER_ID, TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id})); //$NON-NLS-1$ + fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, + new String[] { ATT_MODEL_PROVIDER_ID, + TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id })); //$NON-NLS-1$ if (contentExtensionId == null) - fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { ATT_CONTENT_EXTENSION_ID, TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id})); //$NON-NLS-1$ + fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, + new String[] { ATT_CONTENT_EXTENSION_ID, + TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id })); //$NON-NLS-1$ } protected void fail(String reason) throws CoreException {