Index: model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java,v retrieving revision 1.131 diff -u -r1.131 JavaBuilder.java --- model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java 19 Apr 2007 17:11:31 -0000 1.131 +++ model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java 8 May 2007 17:53:22 -0000 @@ -587,7 +587,7 @@ } this.binaryLocationsPerProject = new SimpleLookupTable(3); - this.nameEnvironment = new NameEnvironment(workspaceRoot, javaProject, binaryLocationsPerProject); + this.nameEnvironment = new NameEnvironment(workspaceRoot, javaProject, binaryLocationsPerProject, notifier); if (forBuild) { String filterSequence = javaProject.getOption(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, true); Index: model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java,v retrieving revision 1.59 diff -u -r1.59 NameEnvironment.java --- model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java 8 May 2007 17:24:27 -0000 1.59 +++ model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java 8 May 2007 17:53:22 -0000 @@ -30,12 +30,14 @@ boolean isIncrementalBuild; ClasspathMultiDirectory[] sourceLocations; ClasspathLocation[] binaryLocations; - +BuildNotifier notifier; + SimpleSet initialTypeNames; // assumed that each name is of the form "a/b/ClassName" SimpleLookupTable additionalUnits; -NameEnvironment(IWorkspaceRoot root, JavaProject javaProject, SimpleLookupTable binaryLocationsPerProject) throws CoreException { +NameEnvironment(IWorkspaceRoot root, JavaProject javaProject, SimpleLookupTable binaryLocationsPerProject, BuildNotifier notifier) throws CoreException { this.isIncrementalBuild = false; + this.notifier = notifier; computeClasspathLocations(root, javaProject, binaryLocationsPerProject); setNames(null, null); } @@ -259,6 +261,9 @@ } private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeName) { + if (this.notifier != null) + this.notifier.checkCancelWithinCompiler(); + if (this.initialTypeNames != null && this.initialTypeNames.includes(qualifiedTypeName)) { if (isIncrementalBuild) // catch the case that a type inside a source file has been renamed but other class files are looking for it