Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 59793 Details for
Bug 175243
[model] Let working copy owner control the problem requestor used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 40.40 KB, created by
Frederic Fusier
on 2007-02-26 10:35:55 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-02-26 10:35:55 EST
Size:
40.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.java,v >retrieving revision 1.16 >diff -u -r1.16 DefaultWorkingCopyOwner.java >--- model/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.java 10 May 2006 18:03:47 -0000 1.16 >+++ model/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.java 26 Feb 2007 15:31:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -28,9 +28,6 @@ > // only one instance can be created > } > >- /** >- * @deprecated Marked deprecated as it is using deprecated code >- */ > public IBuffer createBuffer(ICompilationUnit workingCopy) { > if (this.primaryBufferProvider != null) return this.primaryBufferProvider.createBuffer(workingCopy); > return super.createBuffer(workingCopy); >Index: model/org/eclipse/jdt/internal/core/CompilationUnit.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java,v >retrieving revision 1.237 >diff -u -r1.237 CompilationUnit.java >--- model/org/eclipse/jdt/internal/core/CompilationUnit.java 12 Dec 2006 17:13:59 -0000 1.237 >+++ model/org/eclipse/jdt/internal/core/CompilationUnit.java 26 Feb 2007 15:31:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -68,6 +68,13 @@ > operation.runOperation(monitor); > } > } >+/* >+ * @see ICompilationUnit#becomeWorkingCopy(IProgressMonitor) >+ */ >+public void becomeWorkingCopy(IProgressMonitor monitor) throws JavaModelException { >+ IProblemRequestor requestor = this.owner == null ? null : this.owner.getProblemRequestor(this); >+ becomeWorkingCopy(requestor, monitor); >+} > protected boolean buildStructure(OpenableElementInfo info, final IProgressMonitor pm, Map newElements, IResource underlyingResource) throws JavaModelException { > > // check if this compilation unit can be opened >@@ -1122,7 +1129,7 @@ > throws JavaModelException { > return reconcile(astLevel, forceProblemDetection, false, workingCopyOwner, monitor); > } >- >+ > /** > * @see ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor) > * @since 3.0 >Index: model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java,v >retrieving revision 1.41 >diff -u -r1.41 ReconcileWorkingCopyOperation.java >--- model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java 6 Sep 2006 08:44:07 -0000 1.41 >+++ model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java 26 Feb 2007 15:31:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -61,7 +61,7 @@ > this.enableStatementsRecovery = enableStatementsRecovery; > this.workingCopyOwner = workingCopyOwner; > } >- >+ > /** > * @exception JavaModelException if setting the source > * of the original compilation unit fails >@@ -76,6 +76,10 @@ > CompilationUnit workingCopy = getWorkingCopy(); > boolean wasConsistent = workingCopy.isConsistent(); > IProblemRequestor problemRequestor = workingCopy.getPerWorkingCopyInfo(); >+ if (problemRequestor != null) { >+ problemRequestor = ((JavaModelManager.PerWorkingCopyInfo)problemRequestor).problemRequestor; >+ } >+ IProblemRequestor ownerProblemRequestor = this.workingCopyOwner.getProblemRequestor(workingCopy); > this.resolveBindings |= problemRequestor != null && problemRequestor.isActive(); > > // create the delta builder (this remembers the current content of the cu) >@@ -93,22 +97,11 @@ > > // report problems > if (this.problems != null && (this.forceProblemDetection || !wasConsistent)) { >- try { >- problemRequestor.beginReporting(); >- for (Iterator iteraror = this.problems.values().iterator(); iteraror.hasNext();) { >- CategorizedProblem[] categorizedProblems = (CategorizedProblem[]) iteraror.next(); >- if (categorizedProblems == null) continue; >- for (int i = 0, length = categorizedProblems.length; i < length; i++) { >- CategorizedProblem problem = categorizedProblems[i]; >- if (JavaModelManager.VERBOSE){ >- System.out.println("PROBLEM FOUND while reconciling : " + problem.getMessage());//$NON-NLS-1$ >- } >- if (this.progressMonitor != null && this.progressMonitor.isCanceled()) break; >- problemRequestor.acceptProblem(problem); >- } >- } >- } finally { >- problemRequestor.endReporting(); >+ if (problemRequestor != null) { >+ reportProblems(workingCopy, problemRequestor); >+ } >+ if (ownerProblemRequestor != null && ownerProblemRequestor != problemRequestor) { >+ reportProblems(workingCopy, ownerProblemRequestor); > } > } > >@@ -122,18 +115,47 @@ > if (this.progressMonitor != null) this.progressMonitor.done(); > } > } >+ >+ /** >+ * Report working copy problems to a given requestor. >+ * >+ * @param workingCopy >+ * @param problemRequestor >+ */ >+ private void reportProblems(CompilationUnit workingCopy, IProblemRequestor problemRequestor) { >+ try { >+ problemRequestor.beginReporting(); >+ for (Iterator iteraror = this.problems.values().iterator(); iteraror.hasNext();) { >+ CategorizedProblem[] categorizedProblems = (CategorizedProblem[]) iteraror.next(); >+ if (categorizedProblems == null) continue; >+ for (int i = 0, length = categorizedProblems.length; i < length; i++) { >+ CategorizedProblem problem = categorizedProblems[i]; >+ if (JavaModelManager.VERBOSE){ >+ System.out.println("PROBLEM FOUND while reconciling : " + problem.getMessage());//$NON-NLS-1$ >+ } >+ if (this.progressMonitor != null && this.progressMonitor.isCanceled()) break; >+ problemRequestor.acceptProblem(problem); >+ } >+ } >+ } finally { >+ problemRequestor.endReporting(); >+ } >+ } >+ > /** > * Returns the working copy this operation is working on. > */ > protected CompilationUnit getWorkingCopy() { > return (CompilationUnit)getElementToProcess(); > } >- /** >- * @see JavaModelOperation#isReadOnly >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.internal.core.JavaModelOperation#isReadOnly() > */ > public boolean isReadOnly() { > return true; > } >+ > /* > * Makes the given working copy consistent, computes the delta and computes an AST if needed. > * Returns the AST. >@@ -232,6 +254,7 @@ > }); > } > } >+ > protected IJavaModelStatus verify() { > IJavaModelStatus status = super.verify(); > if (!status.isOK()) { >@@ -244,5 +267,4 @@ > return status; > } > >- > } >Index: model/org/eclipse/jdt/core/WorkingCopyOwner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/WorkingCopyOwner.java,v >retrieving revision 1.20 >diff -u -r1.20 WorkingCopyOwner.java >--- model/org/eclipse/jdt/core/WorkingCopyOwner.java 13 Jul 2006 11:23:22 -0000 1.20 >+++ model/org/eclipse/jdt/core/WorkingCopyOwner.java 26 Feb 2007 15:31:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -19,7 +19,7 @@ > import org.eclipse.jdt.internal.core.PackageFragment; > > /** >- * The owner of an <code>ICompilationUnit</code> handle in working copy mode. >+ * The owner of an {@link ICompilationUnit} handle in working copy mode. > * An owner is used to identify a working copy and to create its buffer. > * <p> > * Clients should subclass this class to instantiate a working copy owner that is specific to their need and that >@@ -71,6 +71,25 @@ > > return BufferManager.getDefaultBufferManager().createBuffer(workingCopy); > } >+ >+ /** >+ * Returns the problem requestor used by a working copy of this working copy owner. >+ * <p> >+ * By default, no problem requestor is configured. Clients can override this >+ * method to provide a requestor. >+ * </p> >+ * >+ * @param workingCopy The problem requestor used for the given working copy. >+ * If <code>null</code>, then return the problem requestor used for all working >+ * copies of the working copy owner. >+ * @return the problem requestor to be used by working copies of this working >+ * copy owner or <code>null</code> if no problem requestor is configured. >+ * >+ * @since 3.3 >+ */ >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return null; >+ } > > /** > * Returns a new working copy with the given name using this working copy owner to >@@ -81,11 +100,12 @@ > * However this Java project has the given classpath that is used when resolving names > * in this working copy. > * </p><p> >- * A DOM AST created using this working copy will have bindings resolved using the given >- * classpath, and problem are reported to the given problem requestor. >+ * If a DOM AST is created using this working copy, then given classpath will be used >+ * if bindings need to be resolved and problems will be reported to the given problem requestor >+ * if it is not <code>null</code>. > * <p></p> >- * <code>JavaCore#getOptions()</code> is used to create the DOM AST as it is not >- * possible to set the options on the non-existing Java project. >+ * Options used to create the DOM AST are got from {@link JavaCore#getOptions()} >+ * as it is not possible to set the options on a non-existing Java project. > * </p><p> > * When the working copy instance is created, an {@link IJavaElementDelta#ADDED added delta} is > * reported on this working copy. >@@ -111,6 +131,8 @@ > * @return a new working copy > * @see ICompilationUnit#becomeWorkingCopy(IProblemRequestor, IProgressMonitor) > * @since 3.2 >+ * >+ * @deprecated Use {@link #newWorkingCopy(String, IClasspathEntry[], IProgressMonitor)} instead. > */ > public final ICompilationUnit newWorkingCopy(String name, IClasspathEntry[] classpath, IProblemRequestor problemRequestor, IProgressMonitor monitor) throws JavaModelException { > ExternalJavaProject project = new ExternalJavaProject(classpath); >@@ -119,5 +141,52 @@ > result.becomeWorkingCopy(problemRequestor, monitor); > return result; > } >+ >+ /** >+ * Returns a new working copy with the given name using this working copy owner to >+ * create its buffer. >+ * <p> >+ * This working copy always belongs to the default package in a package >+ * fragment root that corresponds to its Java project, and this Java project never exists. >+ * However this Java project has the given classpath that is used when resolving names >+ * in this working copy. >+ * </p><p> >+ * If a DOM AST is created using this working copy, then given classpath will be used >+ * if bindings need to be resolved and problems will be reported to the current working copy >+ * owner problem requestor if it is not <code>null</code>. >+ * <p></p> >+ * Options used to create the DOM AST are got from {@link JavaCore#getOptions()} >+ * as it is not possible to set the options on a non-existing Java project. >+ * </p><p> >+ * When the working copy instance is created, an {@link IJavaElementDelta#ADDED added delta} is >+ * reported on this working copy. >+ * </p><p> >+ * Once done with the working copy, users of this method must discard it using >+ * {@link ICompilationUnit#discardWorkingCopy()}. >+ * </p><p> >+ * Note that when such working copy is committed, only its buffer is saved (see >+ * {@link IBuffer#save(IProgressMonitor, boolean)}) but no resource is created. >+ * </p><p> >+ * This method is not intended to be overriden by clients. >+ * </p> >+ * >+ * @param name the name of the working copy (e.g. "X.java") >+ * @param classpath the classpath used to resolve names in this working copy >+ * @param monitor a progress monitor used to report progress while opening the working copy >+ * or <code>null</code> if no progress should be reported >+ * @throws JavaModelException if the contents of this working copy can >+ * not be determined. >+ * @return a new working copy >+ * @see ICompilationUnit#becomeWorkingCopy(IProgressMonitor) >+ * >+ * @since 3.3 >+ */ >+ public final ICompilationUnit newWorkingCopy(String name, IClasspathEntry[] classpath, IProgressMonitor monitor) throws JavaModelException { >+ ExternalJavaProject project = new ExternalJavaProject(classpath); >+ IPackageFragment parent = project.getPackageFragmentRoot(Path.EMPTY).getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME); >+ CompilationUnit result = new CompilationUnit((PackageFragment) parent, name, this); >+ result.becomeWorkingCopy(getProblemRequestor(result), monitor); >+ return result; >+ } > > } >Index: model/org/eclipse/jdt/core/ICompilationUnit.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java,v >retrieving revision 1.59 >diff -u -r1.59 ICompilationUnit.java >--- model/org/eclipse/jdt/core/ICompilationUnit.java 24 Nov 2006 13:56:36 -0000 1.59 >+++ model/org/eclipse/jdt/core/ICompilationUnit.java 26 Feb 2007 15:31:27 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -70,6 +70,33 @@ > */ > void becomeWorkingCopy(IProblemRequestor problemRequestor, IProgressMonitor monitor) throws JavaModelException; > /** >+ * Changes this compilation unit handle into a working copy. A new {@link IBuffer} is >+ * created using this compilation unit handle's owner. Uses the primary owner is none was >+ * specified when this compilation unit handle was created. >+ * <p> >+ * When switching to working copy mode, problems are reported to the {@link IProblemRequestor >+ * problem requestor} of the {@link WorkingCopyOwner working copy owner}. >+ * </p> >+ * <p> >+ * Once in working copy mode, changes to this compilation unit or its children are done in memory. >+ * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} >+ * will bring the underlying resource in sync with this compilation unit. >+ * </p> >+ * <p> >+ * If this compilation unit was already in working copy mode, an internal counter is incremented and no >+ * other action is taken on this compilation unit. To bring this compilation unit back into the original mode >+ * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many >+ * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. >+ * </p> >+ * >+ * @param monitor a progress monitor used to report progress while opening this compilation unit >+ * or <code>null</code> if no progress should be reported >+ * @throws JavaModelException if this compilation unit could not become a working copy. >+ * @see #discardWorkingCopy() >+ * @since 3.3 >+ */ >+void becomeWorkingCopy(IProgressMonitor monitor) throws JavaModelException; >+/** > * Commits the contents of this working copy to its underlying resource. > * > * <p>It is possible that the contents of the original resource have changed >@@ -223,10 +250,13 @@ > * This has no effect if this compilation unit was not in working copy mode. > * </p> > * <p> >- * If {@link #becomeWorkingCopy} was called several times on this >+ * If <code>becomeWorkingCopy(...)</code> methods was called several times on this > * compilation unit, {@link #discardWorkingCopy} must be called as > * many times before it switches back to the original mode. > * </p> >+ * <p>{@link #discardWorkingCopy()} also has to be called on each compilation unit returned by >+ * {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)}. >+ * </p> > * > * @throws JavaModelException if this working copy could not return in its original mode. > * @see #becomeWorkingCopy(IProblemRequestor, IProgressMonitor) >Index: model/org/eclipse/jdt/core/IJavaElementDelta.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaElementDelta.java,v >retrieving revision 1.34 >diff -u -r1.34 IJavaElementDelta.java >--- model/org/eclipse/jdt/core/IJavaElementDelta.java 29 Sep 2006 17:13:57 -0000 1.34 >+++ model/org/eclipse/jdt/core/IJavaElementDelta.java 26 Feb 2007 15:31:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -19,45 +19,45 @@ > * changed, and any children that have changed. > * <p> > * Deltas have a different status depending on the kind of change they represent. >- * The list below summarizes each status (as returned by <code>getKind</code>) >+ * The list below summarizes each status (as returned by {@link #getKind}) > * and its meaning (see individual constants for a more detailled description): > * <ul> >- * <li><code>ADDED</code> - The element described by the delta has been added.</li> >- * <li><code>REMOVED</code> - The element described by the delta has been removed.</li> >- * <li><code>CHANGED</code> - The element described by the delta has been changed in some way. >- * Specification of the type of change is provided by <code>getFlags</code> which returns the following values: >+ * <li>{@link #ADDED} - The element described by the delta has been added.</li> >+ * <li>{@link #REMOVED} - The element described by the delta has been removed.</li> >+ * <li>{@link #CHANGED} - The element described by the delta has been changed in some way. >+ * Specification of the type of change is provided by {@link #getFlags} which returns the following values: > * <ul> >- * <li><code>F_ADDED_TO_CLASSPATH</code> - A classpath entry corresponding to the element >+ * <li>{@link #F_ADDED_TO_CLASSPATH} - A classpath entry corresponding to the element > * has been added to the project's classpath. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>.</li> >- * <li><code>F_ARCHIVE_CONTENT_CHANGED</code> - The contents of an archive >- * has changed in some way. This flag is only valid if the element is an <code>IPackageFragmentRoot</code> >+ * {@link IPackageFragmentRoot}.</li> >+ * <li>{@link #F_ARCHIVE_CONTENT_CHANGED} - The contents of an archive >+ * has changed in some way. This flag is only valid if the element is an {@link IPackageFragmentRoot} > * which is an archive.</li> >- * <li><code>F_CHILDREN</code> - A child of the element has changed in some way. This flag >- * is only valid if the element is an <code>IParent</code>.</li> >- * <li><code>F_CLASSPATH_REORDER</code> - A classpath entry corresponding to the element >+ * <li>{@link #F_CHILDREN} - A child of the element has changed in some way. This flag >+ * is only valid if the element is an {@link IParent}.</li> >+ * <li>{@link #F_CLASSPATH_REORDER} - A classpath entry corresponding to the element > * has changed position in the project's classpath. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>.</li> >- * <li><code>F_CLOSED</code> - The underlying <code>IProject</code> >- * has been closed. This flag is only valid if the element is an <code>IJavaProject</code>.</li> >- * <li><code>F_CONTENT</code> - The contents of the element have been altered. This flag >+ * {@link IPackageFragmentRoot}.</li> >+ * <li>{@link #F_CLOSED} - The underlying {@link org.eclipse.core.resources.IProject} >+ * has been closed. This flag is only valid if the element is an {@link IJavaProject}.</li> >+ * <li>{@link #F_CONTENT} - The contents of the element have been altered. This flag > * is only valid for elements which correspond to files.</li> >- *<li><code>F_FINE_GRAINED</code> - The delta is a fine-grained delta, that is, an analysis down >+ *<li>{@link #F_FINE_GRAINED} - The delta is a fine-grained delta, that is, an analysis down > * to the members level was done to determine if there were structural changes to members of the element.</li> >- * <li><code>F_MODIFIERS</code> - The modifiers on the element have changed in some way. >- * This flag is only valid if the element is an <code>IMember</code>.</li> >- * <li><code>F_OPENED</code> - The underlying <code>IProject</code> >- * has been opened. This flag is only valid if the element is an <code>IJavaProject</code>.</li> >- * <li><code>F_REMOVED_FROM_CLASSPATH</code> - A classpath entry corresponding to the element >+ * <li>{@link #F_MODIFIERS} - The modifiers on the element have changed in some way. >+ * This flag is only valid if the element is an {@link IMember}.</li> >+ * <li>{@link #F_OPENED} - The underlying {@link org.eclipse.core.resources.IProject} >+ * has been opened. This flag is only valid if the element is an {@link IJavaProject}.</li> >+ * <li>{@link #F_REMOVED_FROM_CLASSPATH} - A classpath entry corresponding to the element > * has been removed from the project's classpath. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>.</li> >- * <li><code>F_SOURCEATTACHED</code> - The source attachment path or the source attachment root path >+ * {@link IPackageFragmentRoot}.</li> >+ * <li>{@link #F_SOURCEATTACHED} - The source attachment path or the source attachment root path > * of a classpath entry corresponding to the element was added. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>.</li> >- * <li><code>F_SOURCEDETACHED</code> - The source attachment path or the source attachment root path >+ * {@link IPackageFragmentRoot}.</li> >+ * <li>{@link #F_SOURCEDETACHED} - The source attachment path or the source attachment root path > * of a classpath entry corresponding to the element was removed. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>.</li> >- * <li><code>F_SUPER_TYPES</code> - One of the supertypes of an <code>IType</code> has changed</li>. >+ * {@link IPackageFragmentRoot}.</li> >+ * <li>{@link #F_SUPER_TYPES} - One of the supertypes of an {@link IType} has changed</li>. > * </ul> > * </li> > * </ul> >@@ -65,11 +65,11 @@ > * <p> > * Move operations are indicated by other change flags, layered on top > * of the change flags described above. If element A is moved to become B, >- * the delta for the change in A will have status <code>REMOVED</code>, >- * with change flag <code>F_MOVED_TO</code>. In this case, >- * <code>getMovedToElement</code> on delta A will return the handle for B. >- * The delta for B will have status <code>ADDED</code>, with change flag >- * <code>F_MOVED_FROM</code>, and <code>getMovedFromElement</code> on delta >+ * the delta for the change in A will have status {@link #REMOVED}, >+ * with change flag {@link #F_MOVED_TO}. In this case, >+ * {@link #getMovedToElement} on delta A will return the handle for B. >+ * The delta for B will have status {@link #ADDED}, with change flag >+ * {@link #F_MOVED_FROM}, and {@link #getMovedFromElement} on delta > * B will return the handle for A. (Note, the handle to A in this case represents > * an element that no longer exists). > * </p> >@@ -78,25 +78,25 @@ > * do not imply anything about the parent or children of the element. > * </p> > * <p> >- * The <code>F_ADDED_TO_CLASSPATH</code>, <code>F_REMOVED_FROM_CLASSPATH</code> and >- * <code>F_CLASSPATH_REORDER</code> flags are triggered by changes to a project's classpath. They do not mean that >+ * The {@link #F_ADDED_TO_CLASSPATH}, {@link #F_REMOVED_FROM_CLASSPATH} and >+ * {@link #F_CLASSPATH_REORDER} flags are triggered by changes to a project's classpath. They do not mean that > * the underlying resource was added, removed or changed. For example, if a project P already contains a folder src, then >- * adding a classpath entry with the 'P/src' path to the project's classpath will result in an <code>IJavaElementDelta</code> >- * with the <code>F_ADDED_TO_CLASSPATH</code> flag for the <code>IPackageFragmentRoot</code> P/src. >+ * adding a classpath entry with the 'P/src' path to the project's classpath will result in an {@link IJavaElementDelta} >+ * with the {@link #F_ADDED_TO_CLASSPATH} flag for the {@link IPackageFragmentRoot} P/src. > * On the contrary, if a resource is physically added, removed or changed and this resource corresponds to a classpath >- * entry of the project, then an <code>IJavaElementDelta</code> with the <code>ADDED</code>, >- * <code>REMOVED</code>, or <code>CHANGED</code> kind will be fired. >+ * entry of the project, then an {@link IJavaElementDelta} with the {@link #ADDED}, >+ * {@link #REMOVED}, or {@link #CHANGED} kind will be fired. > * </p> > * <p> > * Note that when a source attachment path or a source attachment root path is changed, then the flags of the delta contain >- * both <code>F_SOURCEATTACHED</code> and <code>F_SOURCEDETTACHED</code>. >+ * both {@link #F_SOURCEATTACHED} and {@link #F_SOURCEDETACHED}. > * </p> > * <p> >- * No assumptions should be made on whether the java element delta tree is rooted at the <code>IJavaModel</code> >+ * No assumptions should be made on whether the java element delta tree is rooted at the {@link IJavaModel} > * level or not. > * </p> > * <p> >- * <code>IJavaElementDelta</code> object are not valid outside the dynamic scope >+ * {@link IJavaElementDelta} object are not valid outside the dynamic scope > * of the notification. > * </p> > * <p> >@@ -133,49 +133,49 @@ > > /** > * Change flag indicating that the modifiers of the element have changed. >- * This flag is only valid if the element is an <code>IMember</code>. >+ * This flag is only valid if the element is an {@link IMember}. > */ > public int F_MODIFIERS = 0x000002; > > /** > * Change flag indicating that there are changes to the children of the element. >- * This flag is only valid if the element is an <code>IParent</code>. >+ * This flag is only valid if the element is an {@link IParent}. > */ > public int F_CHILDREN = 0x000008; > > /** > * Change flag indicating that the element was moved from another location. >- * The location of the old element can be retrieved using <code>getMovedFromElement</code>. >+ * The location of the old element can be retrieved using {@link #getMovedFromElement}. > */ > public int F_MOVED_FROM = 0x000010; > > /** > * Change flag indicating that the element was moved to another location. >- * The location of the new element can be retrieved using <code>getMovedToElement</code>. >+ * The location of the new element can be retrieved using {@link #getMovedToElement}. > */ > public int F_MOVED_TO = 0x000020; > > /** > * Change flag indicating that a classpath entry corresponding to the element has been added to the project's classpath. >- * This flag is only valid if the element is an <code>IPackageFragmentRoot</code>. >+ * This flag is only valid if the element is an {@link IPackageFragmentRoot}. > */ > public int F_ADDED_TO_CLASSPATH = 0x000040; > > /** > * Change flag indicating that a classpath entry corresponding to the element has been removed from the project's >- * classpath. This flag is only valid if the element is an <code>IPackageFragmentRoot</code>. >+ * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. > */ > public int F_REMOVED_FROM_CLASSPATH = 0x000080; > > /** > * Change flag indicating that a classpath entry corresponding to the element has changed position in the project's >- * classpath. This flag is only valid if the element is an <code>IPackageFragmentRoot</code>. >+ * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. > * @deprecated Use {@link #F_REORDER} instead. > */ > public int F_CLASSPATH_REORDER = 0x000100; > /** > * Change flag indicating that the element has changed position relatively to its siblings. >- * If the element is an <code>IPackageFragmentRoot</code>, a classpath entry corresponding >+ * If the element is an {@link IPackageFragmentRoot}, a classpath entry corresponding > * to the element has changed position in the project's classpath. > * > * @since 2.1 >@@ -183,19 +183,19 @@ > public int F_REORDER = 0x000100; > > /** >- * Change flag indicating that the underlying <code>IProject</code> has been >- * opened. This flag is only valid if the element is an <code>IJavaProject</code>. >+ * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been >+ * opened. This flag is only valid if the element is an {@link IJavaProject}. > */ > public int F_OPENED = 0x000200; > > /** >- * Change flag indicating that the underlying <code>IProject</code> has been >- * closed. This flag is only valid if the element is an <code>IJavaProject</code>. >+ * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been >+ * closed. This flag is only valid if the element is an {@link IJavaProject}. > */ > public int F_CLOSED = 0x000400; > > /** >- * Change flag indicating that one of the supertypes of an <code>IType</code> >+ * Change flag indicating that one of the supertypes of an {@link IType} > * has changed. > */ > public int F_SUPER_TYPES = 0x000800; >@@ -203,14 +203,14 @@ > /** > * Change flag indicating that the source attachment path or the source attachment root path of a classpath entry > * corresponding to the element was added. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>. >+ * {@link IPackageFragmentRoot}. > */ > public int F_SOURCEATTACHED = 0x001000; > > /** > * Change flag indicating that the source attachment path or the source attachment root path of a classpath entry > * corresponding to the element was removed. This flag is only valid if the element is an >- * <code>IPackageFragmentRoot</code>. >+ * {@link IPackageFragmentRoot}. > */ > public int F_SOURCEDETACHED = 0x002000; > >@@ -220,9 +220,9 @@ > * members. > * <p> > * Clients can use this flag to find out if a compilation unit >- * that have a <code>F_CONTENT</code> change should assume that there are >- * no finer grained changes (<code>F_FINE_GRAINED</code> is set) or if >- * finer grained changes were not considered (<code>F_FINE_GRAINED</code> >+ * that have a {@link #F_CONTENT} change should assume that there are >+ * no finer grained changes ({@link #F_FINE_GRAINED} is set) or if >+ * finer grained changes were not considered ({@link #F_FINE_GRAINED} > * is not set). > * > * @since 2.0 >@@ -231,7 +231,7 @@ > > /** > * Change flag indicating that the element's archive content on the classpath has changed. >- * This flag is only valid if the element is an <code>IPackageFragmentRoot</code> >+ * This flag is only valid if the element is an {@link IPackageFragmentRoot} > * which is an archive. > * > * @see IPackageFragmentRoot#isArchive() >@@ -242,7 +242,7 @@ > /** > * Change flag indicating that a compilation unit has become a primary working copy, or that a > * primary working copy has reverted to a compilation unit. >- * This flag is only valid if the element is an <code>ICompilationUnit</code>. >+ * This flag is only valid if the element is an {@link ICompilationUnit}. > * > * @since 3.0 > */ >@@ -250,7 +250,7 @@ > > /** > * Change flag indicating that the raw classpath (or the output folder) of a project has changed. >- * This flag is only valid if the element is an <code>IJavaProject</code>. >+ * This flag is only valid if the element is an {@link IJavaProject}. > * > * @since 3.0 > */ >@@ -258,7 +258,7 @@ > > /** > * Change flag indicating that the resource of a primary compilation unit has changed. >- * This flag is only valid if the element is a primary <code>ICompilationUnit</code>. >+ * This flag is only valid if the element is a primary {@link ICompilationUnit}. > * > * @since 3.0 > */ >@@ -267,7 +267,7 @@ > /** > * Change flag indicating that a reconcile operation has affected the compilation unit AST created in a > * previous reconcile operation. Use {@link #getCompilationUnitAST()} to retrieve the AST (if any is available). >- * This flag is only valid if the element is an <code>ICompilationUnit</code> in working copy mode. >+ * This flag is only valid if the element is an {@link ICompilationUnit} in working copy mode. > * > * @since 3.2 > */ >@@ -275,7 +275,7 @@ > > /** > * Change flag indicating that the categories of the element have changed. >- * This flag is only valid if the element is an <code>IMember</code>. >+ * This flag is only valid if the element is an {@link IMember}. > * > * @since 3.2 > */ >@@ -298,9 +298,10 @@ > * This returns a non-null value if and only if: > * <ul> > * <li>the last reconcile operation on this working copy requested an AST</li> >- * <li>this delta's element is an <code>ICompilationUnit</code> in working copy mode</li> >- * <li>the delta comes from a <code>POST_RECONCILE</code> event >+ * <li>this delta's element is an {@link ICompilationUnit} in working copy mode</li> >+ * <li>the delta comes from a {@link ElementChangedEvent#POST_RECONCILE} event > * </ul> >+ * > * @return the AST created during the last reconcile operation > * @see ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor) > * @see #F_AST_AFFECTED >@@ -334,8 +335,8 @@ > public int getFlags(); > > /** >- * Returns the kind of this delta - one of <code>ADDED</code>, <code>REMOVED</code>, >- * or <code>CHANGED</code>. >+ * Returns the kind of this delta - one of {@link #ADDED}, {@link #REMOVED}, >+ * or {@link #CHANGED}. > * > * @return the kind of this delta > */ >@@ -344,21 +345,21 @@ > /** > * Returns an element describing this element before it was moved > * to its current location, or <code>null</code> if the >- * <code>F_MOVED_FROM</code> change flag is not set. >+ * {@link #F_MOVED_FROM} change flag is not set. > * > * @return an element describing this element before it was moved > * to its current location, or <code>null</code> if the >- * <code>F_MOVED_FROM</code> change flag is not set >+ * {@link #F_MOVED_FROM} change flag is not set > */ > public IJavaElement getMovedFromElement(); > > /** > * Returns an element describing this element in its new location, >- * or <code>null</code> if the <code>F_MOVED_TO</code> change >+ * or <code>null</code> if the {@link #F_MOVED_TO} change > * flag is not set. > * > * @return an element describing this element in its new location, >- * or <code>null</code> if the <code>F_MOVED_TO</code> change >+ * or <code>null</code> if the {@link #F_MOVED_TO} change > * flag is not set > */ > public IJavaElement getMovedToElement(); >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java,v >retrieving revision 1.59 >diff -u -r1.59 WorkingCopyOwnerTests.java >--- src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java 28 Jun 2006 16:12:16 -0000 1.59 >+++ src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java 26 Feb 2007 15:31:57 -0000 >@@ -41,14 +41,12 @@ > public static Test suite() { > return buildModelTestSuite(WorkingCopyOwnerTests.class); > } >+ > // Use this static initializer to specify subset for tests > // All specified tests which do not belong to the class are skipped... > static { >- // Names of tests to run: can be "testBugXXXX" or "BugXXXX") > // TESTS_NAMES = new String[] { "testNewWorkingCopy03" }; >- // Numbers of tests to run: "test<number>" will be run for each number of this array > // TESTS_NUMBERS = new int[] { 2, 12 }; >- // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last } > // TESTS_RANGE = new int[] { 16, -1 }; > } > >@@ -1031,7 +1029,8 @@ > return buffer; > } > }; >- this.workingCopy = owner.newWorkingCopy("X.java", null/*no classpath*/, null/*no problem requestor*/, null/*no progress monitor*/); >+// this.workingCopy = owner.newWorkingCopy("X.java", null/*no classpath*/, null/*no problem requestor*/, null/*no progress monitor*/); >+ this.workingCopy = owner.newWorkingCopy("X.java", null/*no classpath*/, null/*no progress monitor*/); > this.workingCopy.commitWorkingCopy(true, null); > assertFalse("Should not have unsaved changes", this.workingCopy.hasUnsavedChanges()); > } >Index: src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java,v >retrieving revision 1.179 >diff -u -r1.179 AbstractJavaModelTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java 26 Jan 2007 16:49:34 -0000 1.179 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java 26 Feb 2007 15:31:56 -0000 >@@ -1538,7 +1538,7 @@ > } > public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException { > return getWorkingCopy(path, source, false); >- } >+ } > public ICompilationUnit getWorkingCopy(String path, String source, boolean computeProblems) throws JavaModelException { > if (this.wcOwner == null) this.wcOwner = new WorkingCopyOwner() {}; > return getWorkingCopy(path, source, this.wcOwner, computeProblems); >@@ -1632,15 +1632,21 @@ > protected ICompilationUnit newExternalWorkingCopy(String name, final String contents) throws JavaModelException { > return newExternalWorkingCopy(name, null/*no classpath*/, null/*no problem requestor*/, contents); > } >- protected ICompilationUnit newExternalWorkingCopy(String name, IClasspathEntry[] classpath, IProblemRequestor problemRequestor, final String contents) throws JavaModelException { >+ protected ICompilationUnit newExternalWorkingCopy(String name, IClasspathEntry[] classpath, final IProblemRequestor problemRequestor, final String contents) throws JavaModelException { > WorkingCopyOwner owner = new WorkingCopyOwner() { > public IBuffer createBuffer(ICompilationUnit wc) { > IBuffer buffer = super.createBuffer(wc); > buffer.setContents(contents); > return buffer; > } >+ >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ > }; >- return owner.newWorkingCopy(name, classpath, problemRequestor, null/*no progress monitor*/); >+// return owner.newWorkingCopy(name, classpath, problemRequestor, null/*no progress monitor*/); >+ return owner.newWorkingCopy(name, classpath, null/*no progress monitor*/); > } > > public byte[] read(java.io.File file) throws java.io.IOException {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 175243
:
59793
|
60492
|
60544
|
60688