super (msg, cause) should be the first statement in the constructor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

super (msg, cause) should be the first statement in the constructor

OCsite
Hi there,

might it be possible for Groovy to get rid of this stupid Java abomination, especially to allow code like

class Foo {
  Foo(someargs) {
    sanitize-args
    super(sanitized-args)
  }
}

instead of the currently enforced ugly work-arounds (like e.g., using a sanitize static method for each arg or so)?

(The very remote danger of calling a method of an un-initialised object in the code above super-constructor is definitely not an excuse of such a crippling limitation. If the programmer is not a complete nincompoop, he wouldn't; and if he is, he'd shoot his own leg in a plethora of other ways anyway.)

Thanks,
OC