1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fixed bug where types found in project include paths were not considered reachable.

This commit is contained in:
Warren Paul 2008-10-01 20:45:59 +00:00
parent 8da6bfb0f0
commit 87b4f009d3

View file

@ -347,10 +347,11 @@ public class NewClassWizardUtil {
*/ */
public static boolean isTypeReachable(ITypeInfo type, ICProject project, String[] includePaths) { public static boolean isTypeReachable(ITypeInfo type, ICProject project, String[] includePaths) {
ICProject baseProject = type.getEnclosingProject(); ICProject baseProject = type.getEnclosingProject();
if (baseProject != null) { if (baseProject != null && baseProject.equals(project)) {
if (baseProject.equals(project)) {
return true; return true;
} }
// check the include paths
ITypeReference ref = type.getResolvedReference(); ITypeReference ref = type.getResolvedReference();
for (int i = 0; i < includePaths.length; ++i) { for (int i = 0; i < includePaths.length; ++i) {
IPath includePath = new Path(includePaths[i]); IPath includePath = new Path(includePaths[i]);
@ -359,11 +360,11 @@ public class NewClassWizardUtil {
return true; return true;
} else { } else {
// we don't have the real location, so just check the project path // we don't have the real location, so just check the project path
if (baseProject.getProject().getLocation().isPrefixOf(includePath)) if (baseProject != null && baseProject.getProject().getLocation().isPrefixOf(includePath))
return true; return true;
} }
} }
}
return false; return false;
} }