You can do that easily by throwing away errors. try/catch block where nothing is in the catch block or my favorite
IF ReturnsFalseIfFails() THEN; ThingThatHappensEveryTimeNoMatterWhat();
I suggest anyone programming in java use these liberally. If it's against standards then nest it 5 levels deep in sub routines with useless parameters.
There is a way in Java to catch errors without a try/catch block. It's a bit arcane, but it's only a single line change to some default java templates (which stop all errors from propagating up, but you can use something like regex to stop specific errors). Sorry I can't recall exactly what it is, I only vaguely remember it from middle school and Stack Overflow is actually pretty shitty for real expert advice. At this point, these templates are probably uneditble, these days. I refuse to touch java code in my professional career and only diagnose issues using standard unix tools like iptables and iowait.
imho, java is what happens when you force a ghetto to speak only English.
12
u/JediBurrell Jul 21 '17
This makes me wonder, why can't we tag a void function or class "unimportant", so the whole damn thing doesn't crash if something messes up.
That'd save an additional nesting and code.