eclipse-wildwebdeveloper / eclipse-wildwebdeveloper/wildwebdeveloper
POM XML formatter sometimes gets confused with normal XML and hallucinates errors
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 201
- Forks
- 76
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 21
Description
I'm using Eclipse EE 2023-06 with Java 17 on Windows 10.
Sometimes when I'm editing a POM, the new XML editor will get confused and show an error. The error will look like this:
Multiple markers at this line
- Non-parseable POM …/pom.xml: expected START_TAG or END_TAG not TEXT (position: TEXT seen ...</dependency>\r\n\r\n\r\n:\r\n\r\n\t\t\t<d... @120:6)
- Element 'dependencies' cannot contain text content.
The content type is defined as element-only.
Code:
(That's all. Really. There is nothing after "Code:".)
However there is no problem in the XML file. It looks like this. (Note that I am indenting using tabs.)
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>12.2</version>
</dependency>
The error is shown on the first e of <dependency>.
This happens when I open an existing pom and do something like this:
- Paste some string, such as the artifact coordinates, on an empty line so I can use it later.
- Copy a
<dependency>section from above. - Edit the pasted section with the new coordinates.
- Delete the temporary line I added.
If I close the file and reopen it, the same error appears, but a different line is indicated; now it indicates the v of <version>.
If I delete the entire <dependency> section, then the error jumps to the section after that.
Arg, now I even did a Git "replace with HEAD" to remove all changes. When I close the file there is no error. When I open the file, it there's there is this imaginary error. Now even with the file I started with (which showed no errors) before making any changes!
Wow the only way I found around this was to exit Eclipse completely, come back in, and paste the entire section you see above. No typing allowed, because one never knows when it will start seeing imaginary errors again!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in Eclipse EE 2023-06 with Java 17 on Windows 10 using an existing POM and the edit sequence described. Inspect the new XML editor's POM formatting and validation behavior; done means the unchanged or correctly edited POM no longer shows the spurious parse and element-content errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100