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

Đang mở
#1,251 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự cố trong Eclipse EE 2023-06 với Java 17 trên Windows 10, sử dụng một POM hiện có và chuỗi thao tác chỉnh sửa được mô tả. Kiểm tra hành vi định dạng và xác thực POM của trình soạn thảo XML mới; hoàn tất khi POM không thay đổi hoặc được chỉnh sửa đúng cách không còn hiển thị các lỗi parse và element-content giả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!

Ngôn ngữ chính
Java
Star
203
Fork
76
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
30

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-wildwebdeveloper/wildwebdeveloper

Tất cả issue của eclipse-wildwebdeveloper/wildwebdeveloper

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.