Changes this compilation unit handle into a working copy. A new {@link IBuffer} iscreated using this compilation unit handle's owner. Uses the primary owner if none was specified when this compilation unit handle was created.
When switching to working copy mode, problems are reported to given {@link IProblemRequestor}. Note that once in working copy mode, the given {@link IProblemRequestor} is ignored. Only the original {@link IProblemRequestor}is used to report subsequent problems.
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.
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 manytimes as {@link #becomeWorkingCopy(IProblemRequestor,IProgressMonitor)}.
@param problemRequestor a requestor which will get notified of problems detected duringreconciling as they are discovered. The requestor can be set to
null
indicating that the client is not interested in problems.
@param monitor a progress monitor used to report progress while opening this compilation unitor
null
if no progress should be reported
@throws JavaModelException if this compilation unit could not become a working copy.
@see #discardWorkingCopy()
@since 3.0
@deprecated Use {@link #becomeWorkingCopy(IProgressMonitor)} instead.Note that if this deprecated method is used, problems will be reported to the given problem requestor as well as the problem requestor returned by the working copy owner (if not null).