File tree 3 files changed +28
-20
lines changed 3 files changed +28
-20
lines changed Original file line number Diff line number Diff line change @@ -316,11 +316,11 @@ optionalt<symbolt> java_bytecode_convert_methodt::get_lambda_method_symbol(
316
316
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
317
317
const size_t index)
318
318
{
319
- const symbol_exprt &lambda_method_handle = lambda_method_handles.at (index );
319
+ const irept &lambda_method_handle = lambda_method_handles.at (index );
320
320
// If the lambda method handle has an unknown type, it does not refer to
321
- // any symbol (it is a symbol expression with empty identifier)
322
- if (!lambda_method_handle.get_identifier ().empty ())
323
- return symbol_table.lookup_ref (lambda_method_handle.get_identifier ());
321
+ // any symbol (it has an empty identifier)
322
+ if (!lambda_method_handle.id ().empty ())
323
+ return symbol_table.lookup_ref (lambda_method_handle.id ());
324
324
return {};
325
325
}
326
326
Original file line number Diff line number Diff line change @@ -171,19 +171,28 @@ class java_class_typet:public class_typet
171
171
set (ID_final, is_final);
172
172
}
173
173
174
- typedef std::vector<symbol_exprt> java_lambda_method_handlest;
174
+ // it may be better to introduce a class like
175
+ // class java_lambda_method_handlet : private irept
176
+ // {
177
+ // java_lambda_method_handlet(const irep_idt &id) : irept(id)
178
+ // {
179
+ // }
180
+ //
181
+ // const irep_idt &get_lambda_method_handle() const
182
+ // {
183
+ // return id();
184
+ // }
185
+ // };
186
+ using java_lambda_method_handlest = irept::subt;
175
187
176
188
const java_lambda_method_handlest &lambda_method_handles () const
177
189
{
178
- return (const java_lambda_method_handlest &)find (
179
- ID_java_lambda_method_handles)
180
- .get_sub ();
190
+ return find (ID_java_lambda_method_handles).get_sub ();
181
191
}
182
192
183
193
java_lambda_method_handlest &lambda_method_handles ()
184
194
{
185
- return (java_lambda_method_handlest &)add (ID_java_lambda_method_handles)
186
- .get_sub ();
195
+ return add (ID_java_lambda_method_handles).get_sub ();
187
196
}
188
197
189
198
void add_lambda_method_handle (const irep_idt &identifier)
Original file line number Diff line number Diff line change @@ -521,15 +521,14 @@ require_type::require_lambda_method_handles(
521
521
class_type.lambda_method_handles ();
522
522
REQUIRE (lambda_method_handles.size () == expected_identifiers.size ());
523
523
524
- REQUIRE (
525
- std::equal (
526
- lambda_method_handles.begin (),
527
- lambda_method_handles.end (),
528
- expected_identifiers.begin (),
529
- [](
530
- const symbol_exprt &lambda_method_handle,
531
- const std::string &expected_identifier) { // NOLINT
532
- return lambda_method_handle.get_identifier () == expected_identifier;
533
- }));
524
+ REQUIRE (std::equal (
525
+ lambda_method_handles.begin (),
526
+ lambda_method_handles.end (),
527
+ expected_identifiers.begin (),
528
+ [](
529
+ const irept &lambda_method_handle,
530
+ const std::string &expected_identifier) { // NOLINT
531
+ return lambda_method_handle.id () == expected_identifier;
532
+ }));
534
533
return lambda_method_handles;
535
534
}
You can’t perform that action at this time.
0 commit comments