From 1e9686673cce35688d8d4b9d8289875aa7b060c0 Mon Sep 17 00:00:00 2001 From: svorenova Date: Tue, 27 Mar 2018 12:24:14 +0100 Subject: [PATCH] Tidying up for TG-2478 --- src/java_bytecode/java_bytecode_convert_method.cpp | 5 ++--- src/java_bytecode/java_bytecode_convert_method_class.h | 2 +- src/java_bytecode/java_bytecode_parser.cpp | 2 +- src/java_bytecode/java_types.h | 2 ++ unit/testing-utils/require_parse_tree.cpp | 1 - 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index d801c67aaed1..f1e5b8f51a37 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 aa3a008faaf6..198a5b0306a1 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_bytecode_parser.cpp b/src/java_bytecode/java_bytecode_parser.cpp index 46ab444d380b..799b41b504cb 100644 --- a/src/java_bytecode/java_bytecode_parser.cpp +++ b/src/java_bytecode/java_bytecode_parser.cpp @@ -1792,7 +1792,7 @@ java_bytecode_parsert::parse_method_handle(const method_handle_infot &entry) // "new" when it is a class variable, instantiated in lambda_method_handle.lambda_method_name = name_and_type.get_name(pool_entry_lambda); - lambda_method_handle.lambda_method_ref = method_ref; + lambda_method_handle.lambda_method_ref = std::move(method_ref); lambda_method_handle.handle_type = method_handle_typet::LAMBDA_METHOD_HANDLE; diff --git a/src/java_bytecode/java_types.h b/src/java_bytecode/java_types.h index aba2e12a8203..56c7e14efe3b 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 6534e478a2bf..4cee0089417f 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; }