diff options
Diffstat (limited to 'org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java')
-rw-r--r-- | org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java index b616d8f8..f9ae011c 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java @@ -1,10 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 + * Copyright (c) 2000, 2005 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 - * http://www.eclipse.org/legal/cpl-v10.html - * + * http://www.eclipse.org/legal/epl-v10.html + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -32,18 +32,20 @@ public class RegionBasedTypeHierarchy extends TypeHierarchy { * The region of types for which to build the hierarchy */ protected IRegion region; - + /** * Creates a TypeHierarchy on the types in the specified region, * considering first the given working copies, - * using the given project for a name lookup contenxt. If a specific + * using the projects in the given region for a name lookup context. If a specific * type is also specified, the type hierarchy is pruned to only * contain the branch including the specified type. */ -public RegionBasedTypeHierarchy(IRegion region, IJavaProject project, ICompilationUnit[] workingCopies, IType type, boolean computeSubtypes) { +public RegionBasedTypeHierarchy(IRegion region, ICompilationUnit[] workingCopies, IType type, boolean computeSubtypes) { super(type, workingCopies, (IJavaSearchScope)null, computeSubtypes); this.region = region; - this.project = project; + IJavaElement[] elements = region.getElements(); + if (elements.length > 0) + this.project = elements[0].getJavaProject(); } /* * @see TypeHierarchy#initializeRegions |