JetBrains / JetBrains/java-annotations

Ability to hint proper parameter names for functional interfaces

Đang mở
#54 0 bình luận 6 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Kotlin
Star
463
Fork
72
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am (re)-using multiple common functional interfaces in my code, and the parameter names sometimes do not properly match the intent. For example `DoubleUnaryOperator` taking a double generically named `operand`.

I believe there could be an annotation hinting the IDE into using our own name
```java
// What is currently suggested
Vec.ZERO.withX(operand -> operand * 5);
// With hint
Vec.ZERO.withX(x -> x * 5);

// Similar example using UnaryOperator
// What is currently suggested
itemBuilder.meta(itemMetaBuilder -> itemMetaBuilder);
// With hint
itemBuilder.meta(metaBuilder -> metaBuilder);
```

The alternative would be creating my own interfaces, which feels a bit unnecessary.

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.