github / github/codeql

Java: JavadocTag does not contain multi-line JavadocText children

Đang mở
#3,825 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Java question
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**Description of the issue**
Related to #3696

It appears QL is only considering the first line of `JavadocTag` text and not considering any subsequent lines.
Example query for LGTM demo projects:
```ql
import java

from JavadocTag javadocTag
where
javadocTag.getText() = "type of the hashing function (see"
select javadocTag, javadocTag.getNumChild(), javadocTag.getText()
```
[Query console link](https://lgtm.com/query/3510661099047413739/)

Note how it always claims that the tags have only two children (the tag name and a JavadocText) and how for multi-line text, all lines after the first one are missing.

Additionally, if the text for a block tag starts in the next line, no child is reported, e.g.:
```java
/**
* @deprecated
* Some text
* More text
* Even more text
*/
```

Expected would be that all subsequent lines would be separate `JavadocText` (see also #3696) and that they are considered children of the `JavadocTag`. Additionally `getText()` should (probably?) concat them with `\n` (new line) or a space, and it would also be useful to add a `JavadocText getATextChild()` predicate to `JavadocTag` as well then.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.