Skip to content

Commit 2964910

Browse files
author
svorenova
committed
Fix a bug in function for extracting generic interface reference
1 parent 5c00440 commit 2964910

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/java_bytecode/java_bytecode_convert_class.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,16 @@ static optionalt<std::string> extract_generic_interface_reference(
151151
start =
152152
find_closing_semi_colon_for_reference_type(signature.value(), start) + 1;
153153

154-
start = signature.value().find("L" + interface_name + "<", start);
154+
// if the interface name includes package name, convert dots to slashes
155+
std::string interface_name_slash_to_dot = interface_name;
156+
std::replace(
157+
interface_name_slash_to_dot.begin(),
158+
interface_name_slash_to_dot.end(),
159+
'.',
160+
'/');
161+
162+
start =
163+
signature.value().find("L" + interface_name_slash_to_dot + "<", start);
155164
if(start != std::string::npos)
156165
{
157166
const size_t &end =

0 commit comments

Comments
 (0)