POM XML formatter sometimes gets confused with normal XML and hallucinates errors

Offen
#1,251 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
tooling

Rechercherichtung

Beginne damit, das Problem in Eclipse EE 2023-06 mit Java 17 unter Windows 10 anhand eines vorhandenen POM und der beschriebenen Bearbeitungssequenz nachzustellen. Untersuche das Formatierungs- und Validierungsverhalten des POM im neuen XML-Editor; abgeschlossen ist die Untersuchung, wenn das unveränderte oder korrekt bearbeitete POM die fälschlicherweise angezeigten Parse- und Element-Content-Fehler nicht mehr zeigt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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:

  1. Paste some string, such as the artifact coordinates, on an empty line so I can use it later.
  2. Copy a <dependency> section from above.
  3. Edit the pasted section with the new coordinates.
  4. 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!

Vorherrschende Sprache
Java
Sterne
201
Forks
76
Ø Merge
4 T. 7 Std.
Gemergte PRs (30 T.)
21

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus eclipse-wildwebdeveloper/wildwebdeveloper

Alle Issues in eclipse-wildwebdeveloper/wildwebdeveloper

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.