[…] Stuart Marks a écrit un article intéressant sur la suppression du Security Manager : Detoxifying the JDK Source Code. […]
]]>[…] JDK 소스 코드의 독성 제거하기 […]
]]>[…] Detoxifying the JDK Source Code […]
]]>In reply to stuartmarks.
the combo is more flexible than if the two groups were split apart into two classes, because this lets you switch back and forth as needed… I’ve used this when I wanted to write a quick and dirty FIX protocol parser
https://en.m.wikipedia.org/wiki/Financial_Information_eXchange
First you can read the hard coded string (no need for tokens here)
8=FIX.4.2 | 9=
which gets right to the point where you need an integer, so you can use nextShort (with the proper delimiter) and then you can get the rest of the message(again no need for tokens)
this barely qualifies as a parser; we have not even attempted to understand the message, but at least it’s good enough to break up a stream into messages at the proper message boundaries.
]]>In reply to stuartmarks.
Thanks a lot. You and your talks on topics related to Java is really awesome. retainAll() was super nice as well which serves as A ∩ B
Thanks again.
In reply to Abhishek.
Hi, thanks for watching my old talk! I guess I never uploaded that file. I’ve done so now. Here’s a link to that file. (I’ve also updated the post to include the link.)
https://stuartmarks.files.wordpress.com/2019/09/ccc.jshell.txt
]]>Hello Stuart,
It was a good learning about the comparator behavior with TreeSet via your talk on Corner Cases. I was looking for the script you used during this talk, would you help locate them.
Thanks
[…] Incompatibilities with JDK 15 CharSequence.isEmpty […]
]]>[…] The Importance of Writing Stuff Down […]
]]>In reply to Antonio Lago.
Right, the idea of SequencedCollection elements having successors and predecessors is mostly for definitional purposes. There aren’t any such operations in the APIs, as you noted.
You might look at NavigableSet, which has higher(E) and lower(E) methods that let you find the adjacent elements. NavigableMap has similar methods for finding adjacent keys and entries, given a key. Using these APIs you can “iterate” through a NavigableSet or NavigableMap without using an explicit Iterator object.
]]>