Problem handling read-only files [message #133890] |
Mon, 22 September 2003 09:41  |
Eclipse User |
|
|
|
I have been examining the support provided by the Eclipse core component for
dealing with read-only files. The reason for this is that I am involved in a
project that is developing a Team provider and I have had some bad
experiences with read-only files and another Team provider in the past.
In the course of my investigations, I discovered that the methods
org.eclipse.core.internal.resources.Workspace.validateEdit and
org.eclipse.core.internal.resources.Workspace.validateSave both test the
member variable "shouldValidate" before checking to see if a validator
exists. if "shouldValidate" is false, no attempt to check for the existence
of, or to create a validator is made.
It turns out, however, that the only way to set this variable to true is to
call the method
org.eclipse.core.internal.resources.Workspace.initializeVali dator. This
method is only invoked from the methods validateEdit and validateSave. and
will only be invoked if the variable "shouldValidate" is already set to
true.
The end result is that the validator hook is never created and hence that
the VCM component is never given the chance to hear about the state of these
files.
I have some questions on this.
1. Is this behaviour a bug or is it deliberate?
2. If it is a bug, would Eclipse be interested in a patch along with a test
case to validate the behaviour (no test case appears to exist at core level
and the test cases that exist in Team and JDT do not seem to exercise the
core functionality)?
3. If the behaviour is deliberate could you give an explanation of the
rationale for this behaviour and some suggestions on what would be necessary
to change the behaviour so that Team providers would get the chance to react
to read-only files?
Regards
Jonathan Gossage
|
|
|
Re: Problem handling read-only files [message #137717 is a reply to message #133890] |
Mon, 29 September 2003 18:09  |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
Sorry for the lack of response, I must have missed this message. The
initial value of shouldValidate is true. The first time validateEdit is
called, shouldValidate==true and validator==null, causing it to call
shouldValidate. If shouldValidate is ever false, it means that core
tried to initialize the validator and it failed to do so. Check you log
file for an error message.
--
Jonathan Gossage wrote:
> I have been examining the support provided by the Eclipse core component for
> dealing with read-only files. The reason for this is that I am involved in a
> project that is developing a Team provider and I have had some bad
> experiences with read-only files and another Team provider in the past.
>
> In the course of my investigations, I discovered that the methods
> org.eclipse.core.internal.resources.Workspace.validateEdit and
> org.eclipse.core.internal.resources.Workspace.validateSave both test the
> member variable "shouldValidate" before checking to see if a validator
> exists. if "shouldValidate" is false, no attempt to check for the existence
> of, or to create a validator is made.
>
> It turns out, however, that the only way to set this variable to true is to
> call the method
> org.eclipse.core.internal.resources.Workspace.initializeVali dator. This
> method is only invoked from the methods validateEdit and validateSave. and
> will only be invoked if the variable "shouldValidate" is already set to
> true.
>
> The end result is that the validator hook is never created and hence that
> the VCM component is never given the chance to hear about the state of these
> files.
>
> I have some questions on this.
>
> 1. Is this behaviour a bug or is it deliberate?
>
> 2. If it is a bug, would Eclipse be interested in a patch along with a test
> case to validate the behaviour (no test case appears to exist at core level
> and the test cases that exist in Team and JDT do not seem to exercise the
> core functionality)?
>
> 3. If the behaviour is deliberate could you give an explanation of the
> rationale for this behaviour and some suggestions on what would be necessary
> to change the behaviour so that Team providers would get the chance to react
> to read-only files?
>
> Regards
>
> Jonathan Gossage
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.50784 seconds