Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Instants get not deserialized as expected sometimes (millis vs nanos, non-fractional numbers)

オープン
#304 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

まず READ_DATE_TIMESTAMPS_AS_NANOSECONDS と WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS の処理箇所を特定し、次にミリ秒値 1709296652087 のデシリアライズを再現してください。整数のタイムスタンプが小数値とどのように区別されるかを確認し、提案されたオプションを実装またはテストする前に、秒、ミリ秒、マイクロ秒、ナノ秒について期待する動作を定義してください。

索引モデルが issue の本文から書いたものです。

説明

test-needed

Hey guys,

I bumped into this issue and it took me some time to figure out what was wrong on my side.
Maybe you don't even consider this as an issue but let me explain first what happened on my side.

When having the flag disabled for WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS

It will eventually write timestamps in Milliseconds:
1709296652087

When I now missed the flag READ_DATE_TIMESTAMPS_AS_NANOSECONDS

and read this we will get an insane Instant consisting of:
Seconds 1709296652087
and
Nanos 0

Using any site online it would understand and consider it as a Milliseconds timestamp.

I guess usually you would just split up a timestamp with a dot and put it to Seconds and Nanos, but I think theoretically both should be possible.

So do you think we could have a feature where we parse values based on their length?
11 characters or less = Seconds
12 to 15 characters = Millis
16 to 18 characters = Micros
19 to 21 characters = Nanos

While writing I am realizing that this might feel less consistent but I also think this might be an interesting flag to add,
you be the judge.

主要言語
Java
スター
425
フォーク
125
平均マージ
19分
マージ済み PR(30日)
1

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FasterXML/jackson-modules-java8 のほかの issue

FasterXML/jackson-modules-java8 の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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