Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 104320 - Should not call IDocumentSetupParticipant.setup(IDocument)
Summary: Should not call IDocumentSetupParticipant.setup(IDocument)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Kevin Barnes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 04:14 EDT by Dani Megert CLA
Modified: 2006-07-17 12:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2005-07-19 04:14:19 EDT
R3.1

When looking at bug 71081 I found that Ant is calling
IDocumentSetupParticipant.setup(IDocument) outside the file buffers framework on
their own. In general this should not be done.

I found two use cases where Ant does this:
- in the document provider
  this is the one that worries me and has probably been added to make external 
  and CVS documents work. A better approach is to use ForwardingDocumentProvider
  as done in PropertiesFileDocumentProvider or CU document provider.
- when creating an empty document ==> this might be a good and valid choice for 
  performance reasons but only if the document is totally private. Otherwise
  let the text file buffer manager create the document
Comment 1 Darin Swanson CLA 2006-01-18 19:40:50 EST
The case of usage in the document provider is explained in bug 72598 but from my testing on the latest 3.2 this workaround appears to no longer be needed

The other three usages are for totally private preview documents in preference pages and such.

Dani, could you please comment wrt to bug 72598 and resolution of enhancements/bugs that would remove the need for our old workaround.
Comment 2 Dani Megert CLA 2006-01-19 02:52:52 EST
Normally the workaround is not needed if you're using a ForwardingDocumentProvider.
Comment 3 Darin Swanson CLA 2006-01-19 10:13:02 EST
Sorry I was not very clear. On the current code I can remove the workaround and everything appears to work as prescribed. 

This was not the case in 3.1 when Kai and I worked out the workaround.

I will do more testing and plan to release with the "bad" code removed.
Comment 4 Darin Swanson CLA 2006-01-23 12:55:56 EST
Changes made to the AntEditorDocumentProvider to remove unneeded workaround based on testing from bug 72598.
Comment 5 Darin Swanson CLA 2006-01-23 12:56:15 EST
Please verify Kevin.
Comment 6 Kevin Barnes CLA 2006-01-24 20:00:35 EST
verified
Comment 7 Dani Megert CLA 2006-07-17 12:21:12 EDT
This fix probably caused bug 150825.