Skip to content

Commit 881b127

Browse files
Refactor: use class_typet instead of struct_typet for java class
1 parent fdba57c commit 881b127

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/java_bytecode/java_bytecode_convert_class.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -478,39 +478,39 @@ void java_bytecode_convert_classt::add_array_types(symbol_tablet &symbol_table)
478478
if(symbol_table.has_symbol(symbol_type_identifier))
479479
return;
480480

481-
struct_typet struct_type;
481+
class_typet class_type;
482482
// we have the base class, java.lang.Object, length and data
483483
// of appropriate type
484-
struct_type.set_tag(symbol_type_identifier);
484+
class_type.set_tag(symbol_type_identifier);
485485

486-
struct_type.components().reserve(3);
487-
struct_typet::componentt
488-
comp0("@java.lang.Object", symbol_typet("java::java.lang.Object"));
486+
class_type.components().reserve(3);
487+
class_typet::componentt comp0(
488+
"@java.lang.Object", symbol_typet("java::java.lang.Object"));
489489
comp0.set_pretty_name("@java.lang.Object");
490490
comp0.set_base_name("@java.lang.Object");
491-
struct_type.components().push_back(comp0);
491+
class_type.components().push_back(comp0);
492492

493-
struct_typet::componentt comp1("length", java_int_type());
493+
class_typet::componentt comp1("length", java_int_type());
494494
comp1.set_pretty_name("length");
495495
comp1.set_base_name("length");
496-
struct_type.components().push_back(comp1);
496+
class_type.components().push_back(comp1);
497497

498-
struct_typet::componentt
499-
comp2("data", java_reference_type(java_type_from_char(l)));
498+
class_typet::componentt comp2(
499+
"data", java_reference_type(java_type_from_char(l)));
500500
comp2.set_pretty_name("data");
501501
comp2.set_base_name("data");
502-
struct_type.components().push_back(comp2);
502+
class_type.components().push_back(comp2);
503503

504504
INVARIANT(
505-
is_valid_java_array(struct_type),
505+
is_valid_java_array(class_type),
506506
"Constructed a new type representing a Java Array "
507507
"object that doesn't match expectations");
508508

509509
symbolt symbol;
510510
symbol.name=symbol_type_identifier;
511511
symbol.base_name=symbol_type.get(ID_C_base_name);
512512
symbol.is_type=true;
513-
symbol.type=struct_type;
513+
symbol.type = class_type;
514514
symbol_table.add(symbol);
515515

516516
// Also provide a clone method:

0 commit comments

Comments
 (0)