github / github/codeql

Java: Add predicates to `InitializerMethod` for getting explicit initializer blocks

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

The CodeQL class `InitializerMethod` (and its subclasses `InstanceInitializer` and `StaticInitializer`) models the implicit initializer method initializing fields and containing the explicit initializer blocks.
However, it appears there is currently no easy way to get the explicit initializer blocks other than trying to inspect the `InitializerMethod` body which can be error-prone.

It might therefore be good to add the following two predicates for `InitializerMethod`:
- `getExplicitInitBlock(int index)`
- `getAnExplicitInitBlock()`

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.