### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java,v retrieving revision 1.140 diff -u -r1.140 CompilationUnitResolver.java --- dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 21 Feb 2010 03:35:50 -0000 1.140 +++ dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 28 May 2010 15:26:40 -0000 @@ -55,7 +55,7 @@ import org.eclipse.jdt.internal.core.BinaryMember; import org.eclipse.jdt.internal.core.CancelableNameEnvironment; import org.eclipse.jdt.internal.core.CancelableProblemFactory; -import org.eclipse.jdt.internal.core.INameEnviromentWithProgress; +import org.eclipse.jdt.internal.core.INameEnvironmentWithProgress; import org.eclipse.jdt.internal.core.JavaProject; import org.eclipse.jdt.internal.core.NameLookup; import org.eclipse.jdt.internal.core.SourceRefElement; @@ -603,7 +603,7 @@ int flags, IProgressMonitor monitor) { - INameEnviromentWithProgress environment = null; + INameEnvironmentWithProgress environment = null; CancelableProblemFactory problemFactory = null; try { if (monitor != null) { @@ -612,7 +612,7 @@ } Classpath[] allEntries = new Classpath[classpaths.size()]; classpaths.toArray(allEntries); - environment = new NameEnviromentWithProgress(allEntries, null, monitor); + environment = new NameEnvironmentWithProgress(allEntries, null, monitor); problemFactory = new CancelableProblemFactory(monitor); CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0); compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0; @@ -652,14 +652,14 @@ IProgressMonitor monitor) throws JavaModelException { CompilationUnitDeclaration unit = null; - INameEnviromentWithProgress environment = null; + INameEnvironmentWithProgress environment = null; CancelableProblemFactory problemFactory = null; CompilationUnitResolver resolver = null; try { if (javaProject == null) { Classpath[] allEntries = new Classpath[classpaths.size()]; classpaths.toArray(allEntries); - environment = new NameEnviromentWithProgress(allEntries, null, monitor); + environment = new NameEnvironmentWithProgress(allEntries, null, monitor); } else { environment = new CancelableNameEnvironment((JavaProject) javaProject, owner, monitor); } Index: dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java =================================================================== RCS file: dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java diff -N dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java --- dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java 21 Feb 2010 03:35:50 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jdt.core.dom; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.jdt.internal.compiler.batch.FileSystem; -import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; -import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; -import org.eclipse.jdt.internal.core.INameEnviromentWithProgress; -import org.eclipse.jdt.internal.core.NameLookup; - -/** - * Batch name environment that is cancelable using a monitor. - * @since 3.6 - */ -class NameEnviromentWithProgress extends FileSystem implements INameEnviromentWithProgress { - IProgressMonitor monitor; - - public NameEnviromentWithProgress(Classpath[] paths, String[] initialFileNames, IProgressMonitor monitor) { - super(paths, initialFileNames); - setMonitor(monitor); - } - private void checkCanceled() { - if (this.monitor != null && this.monitor.isCanceled()) { - if (NameLookup.VERBOSE) { - System.out.println(Thread.currentThread() + " CANCELLING LOOKUP "); //$NON-NLS-1$ - } - throw new AbortCompilation(true/*silent*/, new OperationCanceledException()); - } - } - public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) { - checkCanceled(); - return super.findType(typeName, packageName); - } - public NameEnvironmentAnswer findType(char[][] compoundName) { - checkCanceled(); - return super.findType(compoundName); - } - public boolean isPackage(char[][] compoundName, char[] packageName) { - checkCanceled(); - return super.isPackage(compoundName, packageName); - } - - public void setMonitor(IProgressMonitor monitor) { - this.monitor = monitor; - } -} Index: dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java =================================================================== RCS file: dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java diff -N dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2010 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/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.dom; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.jdt.internal.compiler.batch.FileSystem; +import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; +import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; +import org.eclipse.jdt.internal.core.INameEnvironmentWithProgress; +import org.eclipse.jdt.internal.core.NameLookup; + +/** + * Batch name environment that can be canceled using a monitor. + * @since 3.6 + */ +class NameEnvironmentWithProgress extends FileSystem implements INameEnvironmentWithProgress { + IProgressMonitor monitor; + + public NameEnvironmentWithProgress(Classpath[] paths, String[] initialFileNames, IProgressMonitor monitor) { + super(paths, initialFileNames); + setMonitor(monitor); + } + private void checkCanceled() { + if (this.monitor != null && this.monitor.isCanceled()) { + if (NameLookup.VERBOSE) { + System.out.println(Thread.currentThread() + " CANCELLING LOOKUP "); //$NON-NLS-1$ + } + throw new AbortCompilation(true/*silent*/, new OperationCanceledException()); + } + } + public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) { + checkCanceled(); + return super.findType(typeName, packageName); + } + public NameEnvironmentAnswer findType(char[][] compoundName) { + checkCanceled(); + return super.findType(compoundName); + } + public boolean isPackage(char[][] compoundName, char[] packageName) { + checkCanceled(); + return super.isPackage(compoundName, packageName); + } + + public void setMonitor(IProgressMonitor monitor) { + this.monitor = monitor; + } +} Index: model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java,v retrieving revision 1.12 diff -u -r1.12 CancelableNameEnvironment.java --- model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java 21 Feb 2010 03:35:51 -0000 1.12 +++ model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java 28 May 2010 15:26:40 -0000 @@ -19,7 +19,7 @@ import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; -public class CancelableNameEnvironment extends SearchableEnvironment implements INameEnviromentWithProgress { +public class CancelableNameEnvironment extends SearchableEnvironment implements INameEnvironmentWithProgress { private IProgressMonitor monitor; public CancelableNameEnvironment(JavaProject project, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException { Index: model/org/eclipse/jdt/internal/core/INameEnviromentWithProgress.java =================================================================== RCS file: model/org/eclipse/jdt/internal/core/INameEnviromentWithProgress.java diff -N model/org/eclipse/jdt/internal/core/INameEnviromentWithProgress.java --- model/org/eclipse/jdt/internal/core/INameEnviromentWithProgress.java 21 Feb 2010 03:35:51 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jdt.internal.core; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.internal.compiler.env.INameEnvironment; - -/** - * The name environment provides a callback API that the compiler - * can use to look up types, compilation units, and packages in the - * current environment. The name environment is passed to the compiler - * on creation. - * - * This name environment can be canceled using the monitor passed as an argument to - * {@link #setMonitor(IProgressMonitor)}. - * - * @since 3.6 - */ -public interface INameEnviromentWithProgress extends INameEnvironment { - - /** - * Set the monitor for the given name environment. In order to be able to cancel this name environment calls, - * a non-null monitor should be given. - * - * @param monitor the given monitor - */ - void setMonitor(IProgressMonitor monitor); -} Index: model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java =================================================================== RCS file: model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java diff -N model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ model/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2010 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/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.core; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jdt.internal.compiler.env.INameEnvironment; + +/** + * The name environment provides a callback API that the compiler + * can use to look up types, compilation units, and packages in the + * current environment. The name environment is passed to the compiler + * on creation. + * + * This name environment can be canceled using the monitor passed as an argument to + * {@link #setMonitor(IProgressMonitor)}. + * + * @since 3.6 + */ +public interface INameEnvironmentWithProgress extends INameEnvironment { + + /** + * Set the monitor for the given name environment. In order to be able to cancel this name environment calls, + * a non-null monitor should be given. + * + * @param monitor the given monitor + */ + void setMonitor(IProgressMonitor monitor); +}