@@ -42,8 +42,8 @@ symbolt generate_java_generic_typet::operator()(
42
42
const java_generic_class_typet &generic_class_definition =
43
43
to_java_generic_class_type (to_java_class_type (pointer_subtype));
44
44
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);
47
47
struct_union_typet::componentst replacement_components =
48
48
generic_class_definition.components ();
49
49
@@ -73,8 +73,12 @@ symbolt generate_java_generic_typet::operator()(
73
73
pre_modification_size==after_modification_size,
74
74
" All components in the original class should be in the new class" );
75
75
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
+
78
82
const type_symbolt &class_symbol =
79
83
build_symbol_from_specialised_class (new_java_class);
80
84
@@ -86,7 +90,7 @@ symbolt generate_java_generic_typet::operator()(
86
90
<< " already exists" << messaget::eom;
87
91
}
88
92
89
- const auto expected_symbol=" java::" +id2string (new_tag );
93
+ const auto expected_symbol=" java::" +id2string (generic_name );
90
94
auto symbol=symbol_table.lookup (expected_symbol);
91
95
INVARIANT (symbol, " New class not created" );
92
96
return *symbol;
@@ -184,7 +188,7 @@ typet generate_java_generic_typet::substitute_type(
184
188
// / \param existing_generic_type The type we want to concretise
185
189
// / \param original_class
186
190
// / \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 (
188
192
const java_generic_typet &existing_generic_type,
189
193
const java_class_typet &original_class) const
190
194
{
@@ -227,19 +231,6 @@ irep_idt generate_java_generic_typet::build_generic_tag(
227
231
return new_tag_buffer.str ();
228
232
}
229
233
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
-
243
234
// / Construct the symbol to be moved into the symbol table
244
235
// / \param specialised_class: The newly constructed specialised class
245
236
// / \return The symbol to add to the symbol table
0 commit comments