Cheska Hull's wholesome new life in Thailand: Original Made in Chelsea star has moved 5,800 miles with her son after admitting she 'lost her life' because of the show
Who is the dark horse in the race for Labour's Deputy Leader? ANDREW PIERCE breaks down the runners and riders
Was King Charles right to meet Prince Harry? Have your say in the Palace Confidential poll
Dashboard anxiety plagues IT pros' nights, weekends, vacations
A new survey confirms what many IT pros already know: downtime doesn't exist, with dashboards and alerts intruding on their free time.…
Londoners waiting for the Tube are left baffled as train carrying 'coal' turns up instead - as strikes continue to cripple the capital
Molly-Mae Hague leaves NTAs viewers 'fuming' as she beats favourite Rob Burrow to win major gong
DNA Cassette Tape Can Store Every Song Ever Recorded
Read more of this story at Slashdot.
'I tried the lovely café serving tasty food near peaceful sandy Essex beach'
The Nato night team were watching the drones pounding Ukraine. But then one squadron banked starboard - and headed straight for Poland. Lights started flashing...
Netanyahu warns 'anyone who attacks us - we will reach them' as Israel carries out air strikes targeting Houthi military camps in Yemen a day after attacking Hamas in Qatar
Revealed: Keir Starmer edited manual on interpreting human rights laws that prevent Britain from deporting small boat migrants
Charlie Kirk dead at 31: What we know so far about MAGA star's death at Utah campus that sent shockwaves around the world as FBI botches arrest and Trump promises ultimate punishment
Gary Lineker BEATS Ant and Dec for Best Presenter gong at the National Television Awards in shock win - officially ending Geordie duo's 23-year streak as Strictly and This Morning also win big
Tragedy as Charlie Kirk's wife left behind with two young children after conservative activist is fatally shot
'You made your bed, you can lie in it': The haunting words spat out to an unmarried mother as she was left to give birth alone... before her newborn was snatched and put up for adoption in the blink of an eye
'Questing Quokka' enters UI freeze as Ubuntu 25.10 nears release
The Quokka is a small, furry, and perpetually smiling marsupial from Australia. It's very cute – and now it's freezing.…
CodeSOD: The Getter Setter Getter
Today's Java snippet comes from Capybara James.
The first sign something was wrong was this:
private Map<String, String> getExtractedDataMap(PayloadDto payload) { return setExtractedDataToMap(payload); }Java conventions tell us that a get method retrieves a value, and a set method mutates the value. So a getter that calls a setter is… confusing. But neither of these are truly getters nor setters.
setExtractedDataToMap converts the PayloadDto to a Map<String, String>. getExtractedMap just calls that, which is just one extra layer of indirection that nobody needed, but whatever. At its core, this is just two badly named methods where there should be one.
But that distracts from the true WTF in here. Why on Earth are we converting an actual Java object to a Map<String,String>? That is a definite code smell, a sign that someone isn't entirely comfortable with object-oriented programming. You can't even say, "Well, maybe for serialization to JSON or something?" because Java has serializers that just do this transparently. And that's just the purpose of a DTO in the first place- to be a bucket that holds data for easy serialization.
We're left wondering what the point of all of this code is, and we're not alone. James writes:
I found this gem of a code snippet while trying to understand a workflow for data flow documentation purpose. I was not quite sure what the original developer was trying to achieve and at this point I just gave up
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.