-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
7
-
x86
-
windows_7
A DESCRIPTION OF THE REQUEST :
Requiring super() or this() to be the first call in a constructor is frustrating and does not prevent super methods being called on the object before it is fully constructed. This requirement offers no benefit and hinders developers.
See this stack overflow post for detailed discussion:
http://stackoverflow.com/questions/1168345/why-does-this-and-super-have-to-be-the-first-statement-in-a-constructor
JUSTIFICATION :
For example, I cannot revalidate arguments to my constructor prior to passing them to super.
CUSTOMER SUBMITTED WORKAROUND :
If you can squish your logic into a single mega-statement, try that.
Requiring super() or this() to be the first call in a constructor is frustrating and does not prevent super methods being called on the object before it is fully constructed. This requirement offers no benefit and hinders developers.
See this stack overflow post for detailed discussion:
http://stackoverflow.com/questions/1168345/why-does-this-and-super-have-to-be-the-first-statement-in-a-constructor
JUSTIFICATION :
For example, I cannot revalidate arguments to my constructor prior to passing them to super.
CUSTOMER SUBMITTED WORKAROUND :
If you can squish your logic into a single mega-statement, try that.
- duplicates
-
JDK-4093999 Relax constraint on placement of super() call in constructors
- Closed