@@ -42,8 +42,8 @@ symbolt generate_java_generic_typet::operator()(
4242 const java_generic_class_typet &generic_class_definition =
4343 to_java_generic_class_type (to_java_class_type (pointer_subtype));
4444
45- const irep_idt new_tag =
46- build_generic_tag (existing_generic_type, generic_class_definition);
45+ const irep_idt generic_name =
46+ build_generic_name (existing_generic_type, generic_class_definition);
4747 struct_union_typet::componentst replacement_components =
4848 generic_class_definition.components ();
4949
@@ -73,8 +73,12 @@ symbolt generate_java_generic_typet::operator()(
7373 pre_modification_size==after_modification_size,
7474 " All components in the original class should be in the new class" );
7575
76- const java_specialized_generic_class_typet new_java_class =
77- construct_specialised_generic_type (new_tag, replacement_components);
76+ const java_specialized_generic_class_typet new_java_class{
77+ generic_name,
78+ generic_class_definition.get_tag (),
79+ replacement_components,
80+ existing_generic_type.generic_type_arguments ()};
81+
7882 const type_symbolt &class_symbol =
7983 build_symbol_from_specialised_class (new_java_class);
8084
@@ -86,7 +90,7 @@ symbolt generate_java_generic_typet::operator()(
8690 << " already exists" << messaget::eom;
8791 }
8892
89- const auto expected_symbol=" java::" +id2string (new_tag );
93+ const auto expected_symbol=" java::" +id2string (generic_name );
9094 auto symbol=symbol_table.lookup (expected_symbol);
9195 INVARIANT (symbol, " New class not created" );
9296 return *symbol;
@@ -184,7 +188,7 @@ typet generate_java_generic_typet::substitute_type(
184188// / \param existing_generic_type The type we want to concretise
185189// / \param original_class
186190// / \return A tag for the new generic we want a unique tag for.
187- irep_idt generate_java_generic_typet::build_generic_tag (
191+ irep_idt generate_java_generic_typet::build_generic_name (
188192 const java_generic_typet &existing_generic_type,
189193 const java_class_typet &original_class) const
190194{
@@ -227,19 +231,6 @@ irep_idt generate_java_generic_typet::build_generic_tag(
227231 return new_tag_buffer.str ();
228232}
229233
230- // / Build the specialised version of the specific class, with the specified
231- // / parameters and name.
232- // / \param new_tag: The new name for the class (like Generic<java::Float>)
233- // / \param new_components: The specialised components
234- // / \return The newly constructed class.
235- java_specialized_generic_class_typet
236- generate_java_generic_typet::construct_specialised_generic_type (
237- const irep_idt &new_tag,
238- const struct_typet::componentst &new_components) const
239- {
240- return java_specialized_generic_class_typet{new_tag, new_components};
241- }
242-
243234// / Construct the symbol to be moved into the symbol table
244235// / \param specialised_class: The newly constructed specialised class
245236// / \return The symbol to add to the symbol table
0 commit comments