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

未關閉
#1,251 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
java
領域
tooling

研究方向

首先,使用現有的 POM 和所述編輯順序,在 Windows 10 上使用 Java 17 的 Eclipse EE 2023-06 中重現該問題。檢查新 XML 編輯器的 POM 格式化和驗證行為;當未變更或正確編輯的 POM 不再顯示虛假的剖析和元素內容錯誤時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

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!

主要語言
Java
星號
203
分支
76
平均合併
1 天 5 小時
30 天內合併 PR
30

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

eclipse-wildwebdeveloper/wildwebdeveloper 的其他 Issue

查看 eclipse-wildwebdeveloper/wildwebdeveloper 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。