Why EncodeException's message is not nullable in 1st constructor but nullable in 2nd constructor?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず EncodeException のコンストラクターと RequestTemplateFactoryResolver の resolve メソッドを読み、次にメッセージが null のランタイム例外がどのようにラップされるかを追跡します。両方のコンストラクターに意図された null 許容性の契約を特定し、NegativeArraySizeException 周辺の挙動を検証します。契約と、結果として生成される例外メッセージの挙動に一貫性があれば完了です。
索引モデルが issue の本文から書いたものです。
説明
/**
* @param message the reason for the failure.
*/
public EncodeException(String message) {
super(-1, checkNotNull(message, "message"));
}
/**
* @param message possibly null reason for the failure.
* @param cause the cause of the error.
*/
public EncodeException(String message, Throwable cause) {
super(-1, message, checkNotNull(cause, "cause"));
}
It seems like that EncodeException's message is not null in 1st constructor,
BUT, when a exception with null message is throw (eg. new NegativeArraySizeException() ), you will get a null message EncodeException, such as below codes in RequestTemplateFactoryResolver.
protected RequestTemplate resolve(Object[] argv, RequestTemplate mutable,
Map<String, Object> variables) {
Object body = argv[metadata.bodyIndex()];
checkArgument(body != null, "Body parameter %s was null", metadata.bodyIndex());
try {
encoder.encode(body, metadata.bodyType(), mutable);
} catch (EncodeException e) {
throw e;
} catch (RuntimeException e) {
throw new EncodeException(e.getMessage(), e);
}
return super.resolve(argv, mutable, variables);
}
- 主要言語
- Java
- スター
- 9.8k
- フォーク
- 2k
- 平均マージ
- 1時間 23分
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenFeign/feign のほかの issue
-
DefaultAsyncClient never completes the returned future when Client throws Error対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Response.charset ignores charset after another Content-Type parameter対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
UriUtils ignores allowReservedCharacters=false when the input has no percent triplet対応中かも @hutiefang76 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Java11 Http2Client loses response header value order and duplicate occurrences対応中かも @hutiefang76 が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Java11 Http2Client rejects documented zero connect and read timeouts対応中かも @hutiefang76 が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
OpenFeign/feign の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scylladb/scylla-cdc-source-connector#402 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ahmedmmordi/store-app#8 ·
-
jhipster heroku fails on heroku git:remote when reusing an existing app outside a git repositoryオープンarea: triage theme: undefined
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jhipster/generator-jhipster#36018 ·
メンテナーはふだん 1 日以内に返信