Skip to content

Remove two unnecessary fields from the Java object factory #4432

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

Conversation

antlechner
Copy link
Contributor

No functional change.
The first commit is a follow-up PR to #4416, where it was requested in reviews. The second commit seemed related enough to include it in the same PR.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • n/a Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • n/a My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@antlechner antlechner force-pushed the antonia/object-factory-location branch from 3c49d89 to 8761c52 Compare March 26, 2019 10:55
@antlechner antlechner removed their assignment Mar 26, 2019
@antlechner
Copy link
Contributor Author

This failed CI because of a typo, which I fixed so it should pass now.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 8761c52).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/105827742

An instance of java_object_factoryt is only constructed in two places in
the code. Both times, gen_nondet_init is immediately called on it with
the same source location that was also passed to the constructor.
Storing the same value both in a field and in function parameters is
unnecessary, so the field is removed in this commit.
ns was supposed to always contain a pointer to symbol_table. This kind
of class invariant is unnecessary. It is better to just work with the
symbol table if possible, and construct a namespacet from it whenever we
need it. This way the namespacet can always be declared const and we can
easily see which functions make use of it.
@antlechner antlechner force-pushed the antonia/object-factory-location branch from 8761c52 to dea4be5 Compare March 26, 2019 13:53
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: dea4be5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/105851506

@tautschnig tautschnig merged commit 0184c36 into diffblue:develop Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants