File tree Expand file tree Collapse file tree
smithy-model/src/main/java/software/amazon/smithy/model/loader Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 */
55package software .amazon .smithy .model .loader ;
66
7+ import java .math .BigDecimal ;
78import java .nio .charset .StandardCharsets ;
89import java .time .Instant ;
910import java .time .format .DateTimeParseException ;
@@ -196,8 +197,8 @@ private static Result scanTimestampContents(CharSequence lexeme) {
196197 if (millis == 0 ) {
197198 return Result .ofNumber (epochSecond );
198199 }
199- double value = epochSecond + millis / 1000.0 ;
200- return Result .ofNumber (value );
200+ BigDecimal epochSecondWithMillis = BigDecimal . valueOf ( epochSecond ). add ( BigDecimal . valueOf ( millis , 3 )) ;
201+ return Result .ofNumber (epochSecondWithMillis );
201202 } catch (DateTimeParseException e ) {
202203 throw new RuntimeException ("Invalid RFC 3339 timestamp: " + lexeme );
203204 }
You can’t perform that action at this time.
0 commit comments