@@ -118,11 +118,44 @@ class java_bytecode_convert_classt:public messaget
118
118
// see definition below for more info
119
119
static void add_array_types (symbol_tablet &symbol_table);
120
120
121
+ // / Check if a method is an overlay method by searching for
122
+ // / `ID_overlay_method` in its list of annotations.
123
+ // /
124
+ // / An overlay method is a method with the annotation
125
+ // / \@OverlayMethodImplementation. They should only appear in
126
+ // / [overlay classes](\ref java_class_loader.cpp::is_overlay_class). They
127
+ // / will be loaded by JBMC instead of the method with the same signature
128
+ // / in the underlying class. It is an error if there is no method with the
129
+ // / same signature in the underlying class. It is an error if a method in
130
+ // / an overlay class has the same signature as a method in the underlying
131
+ // / class and it isn't marked as an overlay method or an
132
+ // / [ignored method](\ref java_bytecode_convert_classt::is_ignored_method).
133
+ // /
134
+ // / \param method: a `methodt` object from a java bytecode parse tree
135
+ // / \return true if the method is an overlay method, else false
121
136
static bool is_overlay_method (const methodt &method)
122
137
{
123
138
return method.has_annotation (ID_overlay_method);
124
139
}
125
140
141
+ // / Check if a method is an ignored method by searching for
142
+ // / `ID_ignored_method` in its list of annotations.
143
+ // /
144
+ // / An ignored method is a method with the annotation
145
+ // / \@IgnoredMethodImplementation. They will be ignored by JBMC. They are
146
+ // / intended for use in
147
+ // / [overlay classes](\ref java_class_loader.cpp::is_overlay_class), in
148
+ // / particular for methods which must exist in the overlay class so that
149
+ // / it will compile, e.g. default constructors, but which we do not want
150
+ // / to overlay the corresponding method in the
151
+ // / underlying class. It is an error if a method in
152
+ // / an overlay class has the same signature as a method in the underlying
153
+ // / class and it isn't marked as an
154
+ // / [overlay method](\ref java_bytecode_convert_classt::is_overlay_method)
155
+ // / or an ignored method.
156
+ // /
157
+ // / \param method: a `methodt` object from a java bytecode parse tree
158
+ // / \return true if the method is an overlay method, else false
126
159
static bool is_ignored_method (const methodt &method)
127
160
{
128
161
return method.has_annotation (ID_ignored_method);
0 commit comments