- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Is this true?
Admin
In this case no because the 'loop' is only ever run once, it probably should be something like this:
Admin
If the ThreadPoolManager doesn't perform all management of the thread pool a) it's not just a thread WTF (which is all too easy), it's a complete OO WTF b) the title for this article is wrong - it's not even a mismanager, more a witness to mismanagement
Admin
"Error occured in afterExecute method."
TRWTF is the spelling mistake in "occurred".
Admin
I don't see the point trying something if you're not catching anything...
Admin
TRWTF is threads ;-)
Admin
The real WTF is assuming that IBM (isn't that what's meant with "Big Blue"?) does not offshore.
Admin
Admin
This hurts ...
http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html
Admin
Yes it means that the GC can mark it for collection, if it's left assigned, it might be promoted to a later collection.
Admin
I wonder how many more times this will wind up in production, now? Some noob searches for "thread manager," and boom...
Admin
Admin
C++ programmer should try not to code in Java.
Admin
Um,
never gets incremented? is never instantiated?Admin
Maybe subclasses show the errors mentioned but the code posted "only" has static fields mutated in non static methods, also not actually managing any threads.
Admin
Admin
Admin
How did you divine upon such enlightenment?
It's one thing to say one should not carry their C++ habits while coding in Java, its entirely different if you accuse C++ programmers of being crap Java programmers. And for the defense, for the amount of hate C++ is getting these years, it still is a very good and very versatile programming language. And personally, sometimes, an array of function pointers is way better than a lengthy switch case.
Admin
I would change that for the exception is swallowing the inner exception by using throw ex; instead of just throw;
Admin
Admin
This is probably for the best:
Captcha: secundum. Not quite frist.
Admin
Admin
It is not. It is Java where you always must throw an exception.
In fact this is classic WTFecption-Handling: The excpetion is not handled at all, but the log file is polluted with noise. The actual exception-handler will almost certainly also log the exception, so it is logged twice and confuses the reader.
What you should do is either not handle the exception at this place or create a different (layer-specific) exception which contains the original exception as cause, so that teh actual exception handler has the required information to handle the exception and logs it only once!
Admin
Sex & syphilis...
Admin
Clearly, whoever wrote this is one of those people who had heard that "synchronized" is evil, and so are locks.
Either that or else he had a strong belief in his rabbit's foot.
Admin
In very early versions of Java (e.g. 1.1) it was true. In later versions it actually hurt. Not sure the current state, but in any case this is a great example the type of optimization you shouldn't try to do.
Admin
That sounds exactly like how things are done at my company.
Admin
Should be:
If it's left blank, it doesn't need to be there...
Admin
+1+1+1+1+1+1+1+1+1+1+1+1+1
Admin
company of misfit people?
Admin
Word filter, or awesome wordplay? Either way it burned my cheese pretty good.
Admin
What if you just accuse them of being crap programmers in general?
And if function pointers were exclusive to the C++ language, you might have a valid point there, but they aren't. C++ is one giant, steaming mass of WTF from beginning to end. It may not be the worst programming language ever created, but it is without a doubt the worst ever to be taken seriously.
Admin
It's a clbuttic mistake.
Admin
Admin
Synchronized is evil, and so are locks if you don't know what you are doing. Hell, multi-threaded code in general is evil if you don't know what you are doing. This looks suspiciously similar to something I once worked with at some bluish company once. The situation there was a whole bunch of db code that constantly hit race conditions, deadlocks, and other concurrency issues. The team working on it absolutely refused to touch any Java 5 stuff including their concurrency support because they wanted to keep it compatible with Java 1.4 (the rest of the project was on Java 5, but they were convinced they might get other projects throughout the company to use it as well, and those projects might be on Java 1.4). So the result was an in house developed thread pool was made. And while the original author might have known what he was doing, things quickly devolved as more and more people had to maintain it.
Admin
What did you expect in a forum filled with butthats?
Admin
Admin
Buttbuttin's Creed.
Admin
Dammit, forgot to hit the Quote button.
This was in reply to
"It's all fun and games until someone gets buttbuttinated"
Admin
win
Admin
TRWTF is when said noob, upon questioning as to how they came up with this brillant "thread manager", helpfully shows you their source: a Google search response link pointing to...thedailywtf.com.
Admin
you will be buttimilated.
Admin
TRWTF is protected fields (protected STATIC fields?!) and no generics.
Admin
Use threads? Now you have nThreads problems.
Admin
This is turning into a bit of a compebreastion.
Admin
Admin
I like how it slaughters each thread with a NullPointerException (the worker's thread field is never assigned) that bubbles out of a finally block, possibly even nested finallys. That's just magic.
Best code WTF in ages. There's just so much to “love” in there.
Admin
It's almost replicating the old VB6 "On Error Resume Next" - a great facility to bypass any knotty problems with ease :-)
Admin
Oh yeah? Real programmers use butterflies!
Admin
I never use any butterfly in programming.