asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Lychagin (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [ASTERIXDB-2000][RT] Fix roundtrip-ability for INF.
Date Tue, 25 Jul 2017 22:55:41 GMT
Dmitry Lychagin has posted comments on this change.

Change subject: [ASTERIXDB-2000][RT] Fix roundtrip-ability for INF.
......................................................................


Patch Set 1:

(3 comments)

https://asterix-gerrit.ics.uci.edu/#/c/1901/1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ADoublePrinterFactory.java
File asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ADoublePrinterFactory.java:

Line 27: public class ADoublePrinterFactory implements IPrinterFactory {
There are 3 other ADoublePrinterFactory classes under org.apache.asterix.dataflow.data.nontagged.printers
(adm, csv, json.loseless). Do we need to update them as well?

We also need to update AFloatPrinterFactory classes in the same manner.


Line 34:         if (Double.isFinite(d) && !Double.isNaN(d)) {
is this new comparison necessary here (Double.isNaN)? 
isFinite() already returns 'false' for NaN according to the javadoc


Line 38:             ps.print(Double.compare(d, Double.NaN) == 0 ? "NaN"
btw, you could use Double.isNaN() here instead of Double.compare() and then directly compare
value with +INF (d == Double.POSITIVE_INFINITY). Makes things a bit easier to read. but the
existing code works too.


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1901
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I13687822433744afe1ad3439029b2c0887563f9b
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <buyingyi@gmail.com>
Gerrit-Reviewer: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-HasComments: Yes

Mime
View raw message