This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-18
Channels
- # announcements (7)
- # babashka (4)
- # babashka-sci-dev (73)
- # beginners (101)
- # biff (4)
- # calva (33)
- # clerk (36)
- # clj-commons (23)
- # clj-kondo (3)
- # clojure (38)
- # clojure-europe (2)
- # clojurescript (29)
- # datalevin (15)
- # emacs (2)
- # fulcro (8)
- # gratitude (1)
- # hugsql (9)
- # hyperfiddle (43)
- # jobs-discuss (4)
- # lsp (47)
- # malli (7)
- # off-topic (14)
- # pathom (5)
- # practicalli (1)
- # releases (7)
- # shadow-cljs (4)
- # spacemacs (6)
- # sql (7)
- # tools-deps (7)
- # transit (8)
- # xtdb (6)
In transit-java
implementation for MsgpackEmitter
are there some missing else
’s in the two emitInteger
functions? https://github.com/cognitect/transit-java/blob/master/src/main/java/com/cognitect/transit/impl/MsgpackEmitter.java#L65 and https://github.com/cognitect/transit-java/blob/master/src/main/java/com/cognitect/transit/impl/MsgpackEmitter.java#L73.
I’m still researching, but wondering why it emits both the tagged string version and the integer itself. That doesn’t have the potential to emit the same value twice?
did you learn anything else? if so, happy to have an issue for this in transit-java
I was trying to think of a test I could run against the code. I’m not a Java expert, but it seems that you could never have a long variable with a value outside of the min/max range (which seems to make the if condition always false) If that is somehow possible, and that if condition becomes true, then, I believe that code would erroneously emit two values.
I was just looking at this as I try to update to recent msgpack and this doesn't fail because the condition is never true - it's impossible for the if to ever pass, so only the last line is executed
It’s good that the code works, but IMO it is a little confusing reading it. You don’t normally expect to encounter an if condition coded up that can never be true.
Yeah, I will fix it