Skip to content

Commit a72f52a

Browse files
author
Matthias Güdemann
committed
[TG-2585] Support implicitly generic superclasses
Before only generic superclasses where supported for the java generic symbols, as the detection was to match on the suffix `>;`. This commit changes it to match an opening `<` in the superclass reference in order to detect a generic superclass which will also succeed in the case of an implicitly generic one.
1 parent 28c3c9f commit a72f52a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/java_bytecode/java_bytecode_convert_class.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ extract_generic_superclass_reference(const optionalt<std::string> &signature)
112112
signature.value().substr(start, (end - start) + 1);
113113

114114
// if the superclass is generic then the reference is of form
115-
// Lsuperclass-name<generic-types;>;
116-
if(has_suffix(superclass_ref, ">;"))
115+
// `Lsuperclass-name<generic-types;>;` if it is implicitly generic, then the
116+
// reference is of the form
117+
// `Lsuperclass-name<Tgeneric-types;>.Innerclass-Name`
118+
if(superclass_ref.find('<') != std::string::npos)
117119
return superclass_ref;
118120
}
119121
return {};

0 commit comments

Comments
 (0)