From f4282474e861f160b5b1a29eab4f5073ef6ad446 Mon Sep 17 00:00:00 2001 From: svorenova Date: Tue, 27 Mar 2018 12:24:14 +0100 Subject: [PATCH] Tidying up for lambdas --- src/java_bytecode/java_bytecode_convert_method.cpp | 5 ++--- src/java_bytecode/java_bytecode_convert_method_class.h | 2 +- src/java_bytecode/java_types.h | 2 ++ unit/testing-utils/require_parse_tree.cpp | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index d801c67aaed..f1e5b8f51a3 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -311,11 +311,10 @@ code_typet member_type_lazy( /// \param lambda_method_handles Vector of lambda method handles (bootstrap /// methods) of the class where the lambda is called /// \param index Index of the lambda method handle in the vector -/// \return Symbol of the lambda method if the method handle does not have an -/// unknown type +/// \return Symbol of the lambda method if the method handle has a known type optionalt java_bytecode_convert_methodt::get_lambda_method_symbol( const java_class_typet::java_lambda_method_handlest &lambda_method_handles, - const size_t &index) + const size_t index) { const symbol_exprt &lambda_method_handle = lambda_method_handles.at(index); // If the lambda method handle has an unknown type, it does not refer to diff --git a/src/java_bytecode/java_bytecode_convert_method_class.h b/src/java_bytecode/java_bytecode_convert_method_class.h index aa3a008faaf..198a5b0306a 100644 --- a/src/java_bytecode/java_bytecode_convert_method_class.h +++ b/src/java_bytecode/java_bytecode_convert_method_class.h @@ -237,7 +237,7 @@ class java_bytecode_convert_methodt:public messaget optionalt get_lambda_method_symbol( const java_class_typet::java_lambda_method_handlest &lambda_method_handles, - const size_t &index); + const size_t index); // conversion void convert(const symbolt &class_symbol, const methodt &); diff --git a/src/java_bytecode/java_types.h b/src/java_bytecode/java_types.h index aba2e12a820..56c7e14efe3 100644 --- a/src/java_bytecode/java_types.h +++ b/src/java_bytecode/java_types.h @@ -49,10 +49,12 @@ class java_class_typet:public class_typet void add_lambda_method_handle(const irep_idt &identifier) { + // creates a symbol_exprt for the identifier and pushes it in the vector lambda_method_handles().emplace_back(identifier); } void add_unknown_lambda_method_handle() { + // creates empty symbol_exprt and pushes it in the vector lambda_method_handles().emplace_back(); } }; diff --git a/unit/testing-utils/require_parse_tree.cpp b/unit/testing-utils/require_parse_tree.cpp index 6534e478a2b..4cee0089417 100644 --- a/unit/testing-utils/require_parse_tree.cpp +++ b/unit/testing-utils/require_parse_tree.cpp @@ -40,7 +40,6 @@ require_parse_tree::require_lambda_entry_for_descriptor( entry.second.method_type == method_type && entry.second.lambda_method_ref == lambda_method_ref); }); - INFO("Number of matching lambda method entries: " << matches.size()); REQUIRE(matches.size() == 1); return matches.at(0).second; }