Skip to content

Commit c921130

Browse files
author
svorenova
committed
Tidying up for lambdas
1 parent 5cbb758 commit c921130

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,10 @@ code_typet member_type_lazy(
311311
/// \param lambda_method_handles Vector of lambda method handles (bootstrap
312312
/// methods) of the class where the lambda is called
313313
/// \param index Index of the lambda method handle in the vector
314-
/// \return Symbol of the lambda method if the method handle does not have an
315-
/// unknown type
314+
/// \return Symbol of the lambda method if the method handle has a known type
316315
optionalt<symbolt> java_bytecode_convert_methodt::get_lambda_method_symbol(
317316
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
318-
const size_t &index)
317+
const size_t index)
319318
{
320319
const symbol_exprt &lambda_method_handle = lambda_method_handles.at(index);
321320
// If the lambda method handle has an unknown type, it does not refer to

src/java_bytecode/java_bytecode_convert_method_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class java_bytecode_convert_methodt:public messaget
237237

238238
optionalt<symbolt> get_lambda_method_symbol(
239239
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
240-
const size_t &index);
240+
const size_t index);
241241

242242
// conversion
243243
void convert(const symbolt &class_symbol, const methodt &);

src/java_bytecode/java_bytecode_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,7 @@ java_bytecode_parsert::parse_method_handle(const method_handle_infot &entry)
17921792
// "new" when it is a class variable, instantiated in <init>
17931793
lambda_method_handle.lambda_method_name =
17941794
name_and_type.get_name(pool_entry_lambda);
1795-
lambda_method_handle.lambda_method_ref = method_ref;
1795+
lambda_method_handle.lambda_method_ref = std::move(method_ref);
17961796
lambda_method_handle.handle_type =
17971797
method_handle_typet::LAMBDA_METHOD_HANDLE;
17981798

src/java_bytecode/java_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ class java_class_typet:public class_typet
4949

5050
void add_lambda_method_handle(const irep_idt &identifier)
5151
{
52+
// creates a symbol_exprt for the identifier and pushes it in the vector
5253
lambda_method_handles().emplace_back(identifier);
5354
}
5455
void add_unknown_lambda_method_handle()
5556
{
57+
// creates empty symbol_exprt and pushes it in the vector
5658
lambda_method_handles().emplace_back();
5759
}
5860
};

unit/testing-utils/require_parse_tree.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ require_parse_tree::require_lambda_entry_for_descriptor(
4040
entry.second.method_type == method_type &&
4141
entry.second.lambda_method_ref == lambda_method_ref);
4242
});
43-
INFO("Number of matching lambda method entries: " << matches.size());
4443
REQUIRE(matches.size() == 1);
4544
return matches.at(0).second;
4645
}

0 commit comments

Comments
 (0)