github / github/codeql

Java: Callable.getAnException() reports thrown exceptions

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

[`Callable.getAnException()`](https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/Member.qll/predicate.Member$Callable$getAnException.0.html) is documented as:
> Gets an exception that occurs in the `throws` clause of this callable.

Note how it says `throws` clause, not `throw` statement. Yet it appears to be reporting exceptions which do not appear in the `throws` clause, but appear inside `throw` statements:
```ql
import java

from Method m, Exception e
where
m.fromSource()
and e = m.getAnException()
and not e.fromSource()
select m, e.toString()
```
[Query Console link](https://lgtm.com/query/5757069100542810787/)
The found `Exception` elements also seem to cause issues for the Query Console, see #5465.

(This also affects `Callable.getAThrownExceptionType()` which delegates to `getAnException()`.)

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.