Skip to content

Remove unused class_identifier parameter from Java object factory #4506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jbmc/src/java_bytecode/java_object_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,10 @@ void java_object_factoryt::gen_nondet_struct_init(
// This code mirrors the `remove_java_new` pass:
auto initial_object = zero_initializer(expr.type(), source_locationt(), ns);
CHECK_RETURN(initial_object.has_value());
const irep_idt qualified_clsid = "java::" + id2string(struct_tag);
set_class_identifier(
to_struct_expr(*initial_object), ns, struct_tag_typet(qualified_clsid));
to_struct_expr(*initial_object),
ns,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 set_class_identifier doesn't actually use ns. So this parameter could probably be removed, however that is probably a change for another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has a call to ns.follow. I still find it a bit strange that follow is defined only for namespaces and not for symbol tables, but that would definitely be a change for another (much bigger) PR. 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my mistake.

struct_tag_typet("java::" + id2string(struct_tag)));

// If the initialised type is a special-cased String type (one with length
// and data fields introduced by string-library preprocessing), initialise
Expand Down