Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-jst-dev] problem on editing application.xml

hi,I have the following bug.
 
First,create an "Enterprise Application Project" under the j2ee category,and switch to j2ee perspective,make sure project explorer is opened.Exactly,the problem is caused by the "Deployment Descriptor" item.Second,open the application.xml under the META-INF folder in Text Editor,but not the default XML Editor,make some changes to application.xml,and the "*" is shown on the part table.After that,colse application.xml ,select "no" when asking for saving changes, then open it again in the Text Editor,you'll see the unsaved "*" mark still exists on the part table.In fact,the file buffer of application.xml is not cleared when closing it.
I have read some codes and make some debugs,and found the problem is in org.eclipse.jst.j2ee.navigator.internal.FlexibleEMFModelManager class.This class reads application.xml when  initializing the "Deployment Descriptor" tree item,and  finally releases it until the project explorer is disposed,so the reference of the ResourceFileBuffer of application.xml is kept in the lifecycle of the project explorer.For this reason,every time you edit application.xml and colse it without save,the buffer is not discarded next time you open it. If you make a breakboint at the connect() method in ResourceFileBuffer class,you'll find the problem easily.
As I have mentioned,you have to open application.xml in Text Editor,but not XML Editor,this is because the XML Editor is a structured editor.All structured editor include XML editor,dtd editor,schema editor and others,will do revert operation when colsing it without save,the revert operation clears the current buffer and changes it to the underlying file contents.So,I think this is another bug.
 
At last,I have the question,can the application.xml be realeased at once after reading it,but not until the project explorer view disposed. 
  

Back to the top