@@ -45,9 +45,6 @@ class java_object_factoryt
45
45
// / The symbol table.
46
46
symbol_table_baset &symbol_table;
47
47
48
- // / A namespace built from exclusively one symbol table - the one above.
49
- namespacet ns;
50
-
51
48
// / Resolves pointer types potentially using some heuristics, for example
52
49
// / to replace pointers to interface types with pointers to concrete
53
50
// / implementations.
@@ -83,7 +80,6 @@ class java_object_factoryt
83
80
message_handlert &log)
84
81
: object_factory_parameters(_object_factory_parameters),
85
82
symbol_table (_symbol_table),
86
- ns(_symbol_table),
87
83
pointer_type_selector(pointer_type_selector),
88
84
allocate_objects(
89
85
ID_java,
@@ -228,6 +224,7 @@ void java_object_factoryt::gen_pointer_target_init(
228
224
PRECONDITION (expr.type ().id () == ID_pointer);
229
225
PRECONDITION (update_in_place != update_in_placet::MAY_UPDATE_IN_PLACE);
230
226
227
+ const namespacet ns (symbol_table);
231
228
const typet &followed_target_type = ns.follow (target_type);
232
229
233
230
if (followed_target_type.id () == ID_struct)
@@ -490,6 +487,7 @@ void java_object_factoryt::gen_nondet_pointer_init(
490
487
const source_locationt &location)
491
488
{
492
489
PRECONDITION (expr.type ().id ()==ID_pointer);
490
+ const namespacet ns (symbol_table);
493
491
const pointer_typet &replacement_pointer_type =
494
492
pointer_type_selector.convert_pointer_type (
495
493
pointer_type, generic_parameter_specialization_map, ns);
@@ -800,6 +798,7 @@ void java_object_factoryt::gen_nondet_struct_init(
800
798
const update_in_placet &update_in_place,
801
799
const source_locationt &location)
802
800
{
801
+ const namespacet ns (symbol_table);
803
802
PRECONDITION (ns.follow (expr.type ()).id ()==ID_struct);
804
803
PRECONDITION (struct_type.id ()==ID_struct);
805
804
@@ -1000,6 +999,7 @@ void java_object_factoryt::gen_nondet_init(
1000
999
const source_locationt &location)
1001
1000
{
1002
1001
const typet &type = override_type.has_value () ? *override_type : expr.type ();
1002
+ const namespacet ns (symbol_table);
1003
1003
const typet &followed_type = ns.follow (type);
1004
1004
1005
1005
if (type.id ()==ID_pointer)
@@ -1304,6 +1304,7 @@ void java_object_factoryt::gen_nondet_array_init(
1304
1304
PRECONDITION (expr.type ().subtype ().id () == ID_struct_tag);
1305
1305
PRECONDITION (update_in_place != update_in_placet::MAY_UPDATE_IN_PLACE);
1306
1306
1307
+ const namespacet ns (symbol_table);
1307
1308
const typet &type = ns.follow (expr.type ().subtype ());
1308
1309
const struct_typet &struct_type = to_struct_type (type);
1309
1310
const typet &element_type =
@@ -1386,7 +1387,7 @@ bool java_object_factoryt::gen_nondet_enum_init(
1386
1387
{
1387
1388
const irep_idt &class_name = java_class_type.get_name ();
1388
1389
const irep_idt values_name = id2string (class_name) + " .$VALUES" ;
1389
- if (!ns. get_symbol_table () .has_symbol (values_name))
1390
+ if (symbol_table .has_symbol (values_name))
1390
1391
{
1391
1392
log.warning () << values_name
1392
1393
<< " is missing, so the corresponding Enum "
@@ -1395,6 +1396,7 @@ bool java_object_factoryt::gen_nondet_enum_init(
1395
1396
return false ;
1396
1397
}
1397
1398
1399
+ const namespacet ns (symbol_table);
1398
1400
const symbolt &values = ns.lookup (values_name);
1399
1401
1400
1402
// Access members (length and data) of $VALUES array
0 commit comments