JetBrains / JetBrains/java-annotations

Ability to hint proper parameter names for functional interfaces

オープン
#54 コメント 0 件 リアクション 6 件 担当者 0 名 GitHub で見る
主要言語
Kotlin
スター
463
フォーク
72
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。