github / github/codeql

Java: Add predicate for getting ordered super interfaces

Đang mở
#3,818 3 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
There are cases where it is interesting to know in which order interfaces appear in the `implements` / `extends` clause of a class / interface declaration. However, it appears QL currently do not offer a way to determine this. Would it be possible to add a predicate `Interface getSuperinterface(int index)` or similar?

## Use case
I want to find out if a class or interface implements / extends two interfaces which both declare a method with the same signature without overriding a common method, e.g.:
```
interface A {
void test();
}

interface B {
void test();
}

interface Combining extends A, B {
}
```

Here I would get `A` and `B` from `Combining` by using `getASupertype`. Assuming that there are the QL result variables `superA` and `superB` this creates the problem that it yield duplicate results: `super1=A, super2=B` and `super1=B, super2=A`.

If there was a `getSuperinterface(int index)` predicate you could make sure that `super1` appears before `super2` in the `extends` clause, eliminating the duplicate result.

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.