The most powerful Java method ever???



  • This was found by a coworker of mine while looking through some older code:

     public void realignUniverse() throws Exception { ... }
     
    Unfortunately the "powers that be" decided that this method may be a little too powerful, it currently resides within a block comment :-(
     



  • Just a plain Exception??? I would think it would be some sort of 'InsufficientPermissions' Exception that gets thrown if the User is not GOD. :)



  • @jpaull said:

    Just a plain Exception??? I would think it would be some sort of 'InsufficientPermissions' Exception that gets thrown if the User is not GOD. :)

    I'm guessing this program always runs as root, and we all know that root is God.



  • We have an application at my job which has a concept known as a universe. However, I suppose that kind of name could be a WTF in some contexts.



  • @jpaull said:

    Just a plain Exception??? I would think it would be some sort of 'InsufficientPermissions' Exception that gets thrown if the User is not GOD. :)

    This being java, it could very well throw a SecurityException (java's closest thing to "no permissions"), which, being an unchecked exception (direct superclass is RuntimeException), doesn't need a throws tag. Of course, since RuntimeException is a subclass of Exception, the throws tag covers it anyway. Of course, you could always get other interesting exceptions, and extra fun can be had as we don't know the internals of this function, and no documentation is given as to whether or not an exception causes a rollback of any partial completion of the task, which can mean it could potentially leave the cosmos in a state of disorder worse than it was upon entry.



  • Was this taken from some game code?
    It seems likely that it was lying next to other "powerful" methods like DestroyAlienSpaceship() or DistortSpaceTime().


Log in to reply
 

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