From dc30f2cbc5221641aedba041010e0253c3d02d0a Mon Sep 17 00:00:00 2001 From: ehilsdal Date: Thu, 29 Jan 2004 15:50:10 +0000 Subject: [PATCH] Resolution for Bugzilla Bug 46282 When creating obj thru intro constructor init code fails to execute --- docs/progGuideDB/implementation.xml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/progGuideDB/implementation.xml b/docs/progGuideDB/implementation.xml index fcf05583a..96939d29a 100644 --- a/docs/progGuideDB/implementation.xml +++ b/docs/progGuideDB/implementation.xml @@ -217,6 +217,55 @@ + + Initializers and Inter-type Constructors + + + The code for Java initializers, such as the assignment to the + field d in + + + + + + are considered part of constructors by the time AspectJ gets ahold + of bytecode. That is, the assignment of d to the square root of + two happens inside the default constructor of + C. + + + + Thus inter-type constructors will not necessarily run a target + type's initialization code. In particular, if the inter-type + constructor calls a super-constructor (as opposed to a + this constructor), the target type's + initialization code will not be run when that + inter-type constructor is called. + + + + + + It is the job of an inter-type constructor to do all the required + initialization, or to delegate to a this + constructor if necessary. + + + + + -- 2.39.5