You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JonathanxD edited this page May 20, 2017
·
1 revision
Generation steps
After version 4, Bytecode generation was split in a two step processes:
The structure is analyzed and verified, some important data is collected, like all TypeDeclarations including local classes, anonymous classes, etc... and the code is verified in a way that it ensures that generated code will be almost valid, see Verification limitations.
The code is generated from structure using some collected data to improve the generation.
Bridge methods
Bridge methods is very special, CodeAPI-BytecodeWriter tries to generate bridge methods when option is set to true, but this feature is very limited. To CodeAPI-BytecodeWriter infer which methods should be bridged, the super type and implementations should be either TypeDeclaration or a Java Class. The BridgeResolver class also supports custom type resolution, which should resolve to either TypeDeclaration or Java Class.
Anonymous, Local classes and inner classes
The first step is mandatory, because of bytecode limitations, inner classes should be specified at the top of class. In CodeAPI 4, there is no inner class concept, to generate inner classes you should write the logic yourself, I will explain this later.