Bug 309009 - Reference to getBuffer() seems inconsistent with working copies
Summary: Reference to getBuffer() seems inconsistent with working copies
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-13 10:58 EDT by Olivier Thomann CLA
Modified: 2010-04-26 13:45 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2010-04-13 10:58:56 EDT
The creation of a buffer can potentially be overridden for a working copy by overriding the method:
org.eclipse.jdt.core.WorkingCopyOwner.createBuffer(ICompilationUnit)

But it looks like there are some calls that retrieve the buffer of a working copy without checking this method.
org.eclipse.jdt.internal.core.ClassFileWorkingCopy.openBuffer(IProgressMonitor, Object)

org.eclipse.jdt.internal.core.CompilationUnit.openBuffer(IProgressMonitor, Object)

Some calls directly target the buffer manager without checking if the buffer should be retrieved through the working copy owner.
For example:
org.eclipse.jdt.internal.core.CompilationUnit.getContents()

This looks suspicious.
Comment 1 Olivier Thomann CLA 2010-04-13 11:00:08 EDT
Jay, please have a look at this.
I believe we can get inconsistencies if the working copy owner is used to set the buffer of the working copy.
Comment 2 Olivier Thomann CLA 2010-04-13 12:08:24 EDT
Closing as INVALID.
Only the creation of the buffer should use the working copy owner.
All further calls to the buffer should go through the buffer manager.
It looks ok.
Comment 3 Ayushman Jain CLA 2010-04-26 02:33:41 EDT
Verified for 3.6M7
Comment 4 Jay Arthanareeswaran CLA 2010-04-26 13:45:01 EDT
Verified.