github / github/codeql

Java: JavadocElement location is off by one

未关闭
#5,816 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
Java question
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

### Version
CodeQL CLI v.2.5.2

### Description
It appears for every `JavadocElement` the location within the Java source is off by one, and this adds up for every subsequent element.

### Example
Java source:
```java
/**
* test1234567890
* test1234567890
* test1234567890
* test1234567890
* test1234567890
* @author test1234567890
* @author test1234567890
* @author test1234567890
* @author test1234567890
* @author test1234567890
*/
class Test {
}
```

Code QL query:
```ql
import java

from JavadocElement j
select j, j.getLocation().getStartColumn()
```

Run the query for example in VSCode and click on each of the results
:x: Each `JavadocElement` is shifted to the left by one (in addition to the offset of previous elements):
![VSCode extension screenshot](https://user-images.githubusercontent.com/11685886/116763699-ae016580-aa1e-11eb-8ee8-b0cb9a7845d7.png)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。