WtfException



  • Taken directly from our production codebase, and it's never used:

    public class WtfException extends Exception {
    private static final long serialVersionUID = 1L;

    public WtfException(NoSuchMethodException e) {
    	// TODO Auto-generated constructor stub
    }
    
    public WtfException(SecurityException e) {
    	// TODO Auto-generated constructor stub
    }
    
    public WtfException(IllegalAccessException e) {
    	// TODO Auto-generated constructor stub
    }
    
    public WtfException(IllegalArgumentException e) {
    	// TODO Auto-generated constructor stub
    }
    

    }



  • The only WTF I see there is Java.



  • Nice! It eats a couple of WTF-worthy unchecked Exceptions and turns it into a WTFException.

    I'd add IndexOutOfBoundsException and NullPointerException to that. :P



  • So, you would see it if it was java, and now you don't?



  • Does wtf actually stand for something, or is it a developer's clever way of throwing guard-like exceptions where the program has encountered a condition that breaks the laws of logic such as:

    if (x)

    {

    // x

    }else if (!x)

    {

    // !x

    }

    else {

    throw WtfException("Whaaa?");

    }



  • @RHuckster said:

    guard-like exceptions where the program has encountered a condition that breaks the laws of logic such as:

    if (x)

    {

    // x

    }else if (!x)

    {

    // !x

    }

    else {

    throw WtfException("Whaaa?");

    }

    It's entirely possible to reach that 3rd clause if x changes from false to true between the first and second tests.



  •  @PJH said:

    It's entirely possible to reach that 3rd clause if x changes from false to true between the first and second tests.

    Understood, but the exception is still a wtf and should not be possible if your mutexes or semaphores are coded properly.



  • @RHuckster said:

     @PJH said:

    It's entirely possible to reach that 3rd clause if x changes from false to true between the first and second tests.

    Understood, but the exception is still a wtf and should not be possible if your mutexes or semaphores are coded properly.

    It's a Warning: Threading Failure exception



  • @Zecc said:

    @RHuckster said:

     @PJH said:

    It's entirely possible to reach that 3rd clause if x changes from false to true between the first and second tests.

    Understood, but the exception is still a wtf and should not be possible if your mutexes or semaphores are coded properly.

    It's a Warning: Threading Failure exception
     

    I must integrate this into all my new projects now.



  • @RHuckster said:

    Does wtf actually stand for something, or is it a developer's clever way of throwing guard-like exceptions where the program has encountered a condition that breaks the laws of logic such as:

    if (x) { /* x */ }

    else if (!x) { /* !x */ }

    else { throw WtfException("Whaaa?"); }

    Nothing so complex. There are no mutexes or semaphores in our code, even though it is very much threaded; they rely on timers, and marker files (don't get me started).

    A quick perusal through source control shows that this was once used in I-tested-for-and-caught-an-error-but-dont-know-what-to-do-with-it scenarios. It has since been replaced with: "{ /* ignore */ }"

     



  • @snoofle said:

    marker files (don't get me started)
    o_o



  • @snoofle said:

    they rely on timers, and marker files (don't get me started).

    Holy crap. Do they also rely on "well, it worked on my machine"?



  • @b-redeker said:

    @snoofle said:

    they rely on timers, and marker files (don't get me started).

    Holy crap. Do they also rely on "well, it worked on my machine"?

    Yes, yes they do. You wouldn't believe the fights that go on here. It's like watching Abbott and Costello meet the Keystone Cops meet the 3 Stooges.

     



  • @snoofle said:

    It's like watching Abbott and Costello meet the Keystone Cops meet the 3 Stooges.

    Hey! You've been reading my fan-fics!



  • @blakeyrat said:

    @snoofle said:
    It's like watching Abbott and Costello meet the Keystone Cops meet the 3 Stooges.

    Hey! You've been reading my fan-fics!

     

    It's probably too much to hope for that there's no slashfic covering this description.



  • @snoofle said:

    There are no mutexes or semaphores in our code, even though it is very much threaded; they rely on timers, and marker files (don't get me started).
     

     Wow... just wow! Sounds like there is a full-on article here. 

     @snoofle said:

    It's like watching Abbott and Costello meet the Keystone Cops meet the 3 Stooges.

     Please post to YouTube. I'll make popcorn!



  • @DeepThought said:

    Filed under: sounds like someone needs to get fired

    From a rail gun.



  • @bannedfromcoding said:

    From a rail gun.
     

    I can never get behind the poorly used punchline-delivery tactic of "two words: X Y".

    It should have just finished with the mention that they borrowed the rail gun.



  • @dhromed said:

    @bannedfromcoding said:

    From a rail gun.
     

    I can never get behind the poorly used punchline-delivery tactic of "two words: X Y".

    It should have just finished with the mention that they borrowed the rail gun.

    there are four words: "two words: 'two words'"



  • @Ben L. said:

    @dhromed said:

    @bannedfromcoding said:

    From a rail gun.
     

    I can never get behind the poorly used punchline-delivery tactic of "two words: X Y".

    It should have just finished with the mention that they borrowed the rail gun.

    there are four words: "two words: 'two words'"
    "This sentence" contains twelve letters.

    This sentence contains thirty-six letters.

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.