Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338272 - GAV disappear from form based editor
Summary: GAV disappear from form based editor
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Milos Kleint CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-25 15:14 EST by Pascal Rapicault CLA
Modified: 2021-04-19 13:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2011-02-25 15:14:45 EST
Steps to reproduce:
- Create a new project using the quickstart archetype
- Go in the editor, notice that the form based editor content is correct (GAV is present)
- Go in the xml editor, completely delete the dependencies section
- Use Insert Dependency content assist to add a dependency on spring-core
- Save
- Go back to the overview page, notice that the GAV is gone
Comment 1 Milos Kleint CLA 2011-02-28 02:29:44 EST
sorry, cannot reproduce. can you reproduce reliably on your side?
Comment 2 Pascal Rapicault CLA 2011-02-28 10:51:04 EST
I'm running:
 - Eclipse SDK	3.7.0.I20101208-1300	org.eclipse.sdk.ide
 - m2e - Maven Integration for Eclipse (Incubation)	0.13.0.201102272105	org.eclipse.m2e.feature.feature.group

and I can still reproduces the error.

The steps seem to be even simpler: 
- Create the project using quickstart archetype
- Go in the editor, notice that the form based editor content is correct (GAV
is present)
- Go in the xml editor, completely delete the dependencies section
- Save, go back to the overview tab
Comment 3 Matthew Piggott CLA 2011-03-03 11:51:13 EST
I debugged this a little, the problem is actually pretty funny.

The problem only occurs if you delete the dependencies one line at a time.  Once you've removed the dependencies, dependency & groupId elements the dependency's artifactId element is now a child of the project element.  This causes some sort of collision which sets the artifactId to null on the EMF model.  I assume the value doesn't get reset because the correct artifactId element isn't modified.
Comment 4 Milos Kleint CLA 2011-03-07 04:22:44 EST
Matt, great thanks for debugging. I would have to force Pascal to create a movie of his actions otherwise.  :) It's indeed somewhat funny situation. I'm not convince we need to fix for M6 (given that you need rather special steps to reproduce and the problem was probably present since day 1) -> M7.

The solution I can see is rewrite the pom editor not to use the emf model for reading. The new problem that arises then is how to recognized change done in the xml editor or other panels.

We shall only update the panel content when it's becoming visible (user switches to it) That will have us run less code on user updates (good) and will rely on the user switching only after doing a series of edits and leaving the document in (relatively) good state. As an added bonus, opening of the pom editor could be faster then as well.

Since we will loose the elaborate fine grained notifications from EMF (it tells us for example that a Dependency object has changed only). That will unlikely pose a problem for the Overview page, but might be more important for the other pages, like Dependencies. eg. if the user changes just the version/artifactId in the dependency. Then it can be recognized as Remove of old dependency and Add of the new one instead of the change inside one dependency. Not sure if that aspect is important or not. The only visual effect can be lost selection in the dependencies lists..
Comment 5 Milos Kleint CLA 2011-03-17 06:23:40 EDT
fixed by changes done on branch http://git.eclipse.org/c/m2e/m2e-core.git/log/?h=milos_m7_buffer

not in master yet
Comment 6 Milos Kleint CLA 2011-03-18 03:54:59 EDT
in master now, as far as I can tell the issue is fixed, please verify
Comment 7 Denis Roy CLA 2021-04-19 13:26:46 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/