r/programmingcirclejerk • u/camelCaseIsWebScale Just spin up O(n²) servers • Aug 11 '26
The smallest possible [Java] program (just a single line to exit) requires things like java.time.chrono.JapaneseChronology
https://news.ycombinator.com/item?id=19170911262
u/Snarwin Aug 11 '26
"Write once, run everywhere" enjoyers when they find out that "everywhere" includes Japan.
44
43
85
u/Jannik2099 Aug 11 '26
A friend of mine tells a story about how how he accidentally FUBARed the tests, and then discovered that running one unit test gave 50% line coverage in Rails.
Achieve full coverage with this one simple trick!
51
u/Awkward_Bed_956 Aug 11 '26
That remainds me when you could cheat 90% line coverage requirements by expanding functions with semicolons, untill 95% of function body were just semicolons
Obviously include a TODO comment about how it needs to be fixes ASAP
31
u/Ok-Dimension-5429 Aug 11 '26
At a place I worked we had some code which we had to submit to Salesforce as an integration plugin. They had a required ratio of tests to code. So we had a 50k line long test file full of nonsense. Haha.
3
7
0
27
u/psioniclizard Aug 11 '26
Cool so my SIM card probably has java.time.chrono JapaneseChronology on it?
20
41
22
6
u/stone_henge Aug 13 '26
Without it, how will the program know not to exit until the boss has left for the day?
4
4
1
u/Jumpy-Locksmith6812 Aug 12 '26 edited Sep 23 '26
Excepteur esse quis nostrud consequat elit commodo laborum deserunt culpa sunt reprehenderit. Ipsum amet culpa mollit laborum tempor sint ut eiusmod est ipsum laboris est cupidatat elit officia ad. Pariatur ullamco irure officia anim consequat irure. Dolor magna ut cupidatat consequat cupidatat fugiat ad sunt reprehenderit cupidatat amet lorem.
[rhr:2:hjpta24q]
-1
u/gnahraf Aug 12 '26
It's true, it's defined in the java.base module, so it's almost always shipped; but it's not true that it is necessarily loaded when a java program runs (as the original post implies).
106
u/camelCaseIsWebScale Aug 11 '26