Skip to content

Commit ddc315c

Browse files
committed
Generating synthetic method name in centralized place
1 parent 7b13a1e commit ddc315c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/java-class-info/entry_point.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <java_bytecode/java_types.h>
1414

1515
#include <boost/algorithm/string/predicate.hpp>
16+
#include <boost/algorithm/string/replace.hpp>
1617

1718
entry_pointt::entry_pointt(
1819
const std::string &class_name,
@@ -59,6 +60,8 @@ jsont entry_pointt::to_json()
5960
method_obj[json_namest::return_type] = json_stringt(method.return_type);
6061
method_obj[json_namest::name] = json_stringt(method.name);
6162
method_obj[json_namest::signature] = json_stringt(method.signature);
63+
method_obj[json_namest::synthetic_method_name] = json_stringt(
64+
boost::replace_all_copy(class_name, ".", "") + "_" + method.name);
6265

6366
return json_entry_point;
6467
}

src/java-class-info/entry_point.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class entry_pointt
2121
{
2222
public:
2323
static constexpr const char *name = "name";
24+
static constexpr const char *synthetic_method_name = "syntheticMethodName";
2425
static constexpr const char *signature = "signature";
2526
static constexpr const char *type = "type";
2627
static constexpr const char *arguments = "arguments";

0 commit comments

Comments
 (0)