LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
114
What are some of the biggest problems you personally face in Java?(self.java)
submitted 3 years ago by Reaver75x to /r/java (384.2k)
368 commentsredditother-discussionssubreddit-indexmessage modsop-focus
since 3 years ago
9 of 9

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–][deleted]9 points3 years ago
[deleted] by user
(check your username's removed content. why?)
parenthide replies (2)as-of
[–]plumarr1 point3 years ago

I want to be sure to understand how this would work without type erase.

At runtime the method readValue know the type it should return and then it select the deserializer based on it ?

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–][deleted]3 points3 years ago
[deleted] by user
(check your username's removed content. why?)
parenthide replies (1)as-of
[–]plumarr0 points3 years ago

My brain must be formatted by the use of java because this is scarring me.

What happens if there is no deserializer for the type ? Can you check it at compile time or does it explode with an exception ?

I also fail to see the advantage compared to something like :

var listCar = objectMapper.readListCar(jsonCarArray)

You still only specify the type one time but in the method instead of the assigned variable. You also have to make specific code to handle the Car type in both case, or is objectMapper.readValue dynamically looking for the parser (with reflexion for example) ?

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–][deleted]1 point3 years ago* (edited 14 minutes after)
[deleted] by user
(check your username's removed content. why?)
parenthide replies (1)as-of
[–]plumarr1 point3 years ago* (edited 11 minutes after)

Sorry if it seems like trolling, but I'm really not understanding why this is such a big advantage.

I feel that I'm missing something fundamental but I'll stop there as I don't see this discussion going forward.

permalinkparentcontextauthor-focusas-ofpreserve
[–]lppedd-2 points3 years ago

This is a very specialized tool that probably employee reflection. A couple of years ago I built an MTProto (Telegram's protocol) serializer and deserializer using compile time code generation. Modern libraries and frameworks which do this are heading towards this direction.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]za3faran_tea1 point3 years ago

Did you write it in Java?

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]lppedd1 point3 years ago

Kotlin. I've used a custom parser and KotlinPoet to emit Kotlin classes.

permalinkparentcontextauthor-focusas-ofpreserve
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com