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

Abierto
#1,251 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
java
Área
tooling

Línea de trabajo

Empieza reproduciendo el problema en Eclipse EE 2023-06 con Java 17 en Windows 10 usando un POM existente y la secuencia de edición descrita. Inspecciona el comportamiento de formateo y validación del POM del nuevo editor XML; se considera terminado cuando el POM sin cambios o editado correctamente ya no muestra los errores espurios de parseo y contenido de elementos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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!

Lenguaje dominante
Java
Estrellas
203
Forks
76
Merge medio
1 d 5 h
PR fusionados (30 d)
30

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-wildwebdeveloper/wildwebdeveloper

Todos los issues de eclipse-wildwebdeveloper/wildwebdeveloper

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.