github / github/codeql

Java: For some projects JDK classes have location under `sourceLocationPrefix`

Đang mở
#11,265 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
acknowledged 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ả

### Version
CodeQL CLI 2.11.2

### Description
For some projects JDK classes such as `java/lang/String.class` have a location under the `sourceLocationPrefix` of the database, for example `file:///home/runner/work/quarkus/quarkus/modules/java.base/java/lang/String.class:0:0:0:0`.

This can cause tools such as the VS Code extension to erroneously construct URLs to these files and display them to the user, even though the files are not actually part of the sources and therefore the URLs point to non-existent files.

Expected would be that the location of JDK classes is outside the sources directory (which is the case for most databases), for example `file:///modules/java.base/java/lang/String.class:0:0:0:0`.

Affected projects (GitHub CodeQL databases):
- https://github.com/Activiti/Activiti/commit/a4c8dd6090914ca76e44defa3449b058ec8e8657
- https://github.com/eclipse/jetty.project/commit/df265e0abb30e696f5fe8a8c898c4c8b41e0cef9
- https://github.com/kiegroup/drools/commit/b7dd8323d5e7ba47e826d2a8dffcac09219b8e3f
- https://github.com/qos-ch/logback/commit/ea165fb023f55aec48d3051b817105a69e881eb9
- https://github.com/quarkusio/quarkus/commit/967d3497b585af137e69a980c26ba5af30ab84dc
- https://github.com/redisson/redisson/commit/66390899ea26af7cb0faa46bd677229e73af8ae4

CodeQL query detecting this:
```ql
import java

from TypeString s
select s, s.getLocation(), s.getFile().getRelativePath()
```

Feel free to close this issue if you don't think fixing or adjusting this is worth it.

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.