public Child(java.lang.String);
Code:
stack=2, locals=2, args_size=2
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: aload_0
5: ldc #2 // String John
7: putfield #3 // Field name:Ljava/lang/String;
10: return
public Child(int);
Code:
stack=2, locals=2, args_size=2
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: aload_0
5: ldc #2 // String John
7: putfield #3 // Field name:Ljava/lang/String;
10: return
When we separately compile the aspect, we have no idea which bytecode we might need to copy from existing constructors to initialize fields. In your case you are compiling the source for the target and the source for the aspect together so in compiling the aspect we could look at the target source, but a guiding principal of AspectJ is that separate compilation works the same as 'altogether' compilation so whether the aspect is compiled with the target sources or against the bytecode for that target, it must do the same thing. This means if information cannot be determined from the bytecode, we just don't know it.
Andy