Replace the nullable annotations with guava's Optional class.
まだ誰も着手していません。
評価
調査の方向性
com.sk89q.intake.argument.Namespace から始め、リンクされている Guava Optional のドキュメントと併せて、その get(Object) および get(Class) メソッドを確認します。プロジェクト内で nullable アノテーションを検索し、どの API を置き換える必要があるかを判断します。nullable アノテーションが一貫して Optional の使用に置き換えられ、影響を受ける動作が既存のテストで引き続きカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What's the point of Guava's Optional class?
Probably the single biggest disadvantage of null is that it's not obvious what it should mean in any given context: it doesn't have an illustrative name. It's not always obvious that null means "no value for this parameter" -- heck, as a return value, sometimes it means "error", or even "success" (!!), or simply "the correct answer is nothing". Optional is frequently the concept you actually mean when you make a variable nullable, but not always.
more: http://stackoverflow.com/questions/9561295/whats-the-point-of-guavas-optional-class
Optional class: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Optional.html
Example in com.sk89q.intake.argument.Namespace
/**
* Returns the value specified by the given key.
*
* @param key The key
* @return The value, which may be null, including when the key doesn't exist
*/
public Optional<Object> get(Object key) {
if (!locals.containsKey(key)) Optional.absent();
return Optional.of(locals.get(key));
}
/**
* Get an object whose key will be the object's class.
*
* @param key The key
* @param <T> The type of object
* @return The value
*/
@SuppressWarnings("unchecked")
public <T> Optional<T> get(Class<T> key) {
if (!locals.containsKey(key)) Optional.absent();
return Optional.of((T)locals.get(key));
}
- 主要言語
- Java
- スター
- 102
- フォーク
- 18
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
EngineHub/Intake のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
Localization support オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
EngineHub/Intake の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/gradle-plugins#157 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cryptomator/hub#497 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
johanhaleby/occurrent#1120 ·