Skip to content
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

Prohibit to set static fields from library classes #697 #699

Merged
merged 7 commits into from
Aug 15, 2022

Conversation

sergeypospelov
Copy link
Member

@sergeypospelov sergeypospelov commented Aug 10, 2022

Description

  • It's prohibited now to set static fields from predefined library classes. This is done by filtering fields which are added to meaningfulStaticFields in Traverser. Also these fields won't be substituted with unbounded symbolic variables.
  • Add flag in UtSettings for this feature.
  • Refactored initializedStaticFields field in Memory.
  • Refactored docs for WorkaroundReason.

Fixes #697

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

To reproduce section from #697 works correctly.

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • No new warnings
  • All tests pass locally with my changes

@sergeypospelov sergeypospelov changed the title Prohibit to set static final fields from library classes #697 Prohibit to set static fields from library classes #697 Aug 10, 2022
@sergeypospelov sergeypospelov force-pushed the sergey/static_fields_concrete_processing branch 2 times, most recently from 537d0dd to cea277b Compare August 11, 2022 08:41
@sergeypospelov sergeypospelov requested a review from Damtev August 11, 2022 08:41
@sergeypospelov sergeypospelov force-pushed the sergey/static_fields_concrete_processing branch from cea277b to bbcb4a8 Compare August 12, 2022 11:37
Copy link
Member

@CaelmBleidd CaelmBleidd left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@dtim dtim left a comment

Choose a reason for hiding this comment

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

I agree with comments by @CaelmBleidd (especially w.r.t. condition readability in isStaticFieldMeaningful), but LGTM overall.

@sergeypospelov sergeypospelov enabled auto-merge (squash) August 15, 2022 11:02
@sergeypospelov sergeypospelov merged commit 25707e0 into main Aug 15, 2022
@sergeypospelov sergeypospelov deleted the sergey/static_fields_concrete_processing branch August 15, 2022 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Engine sets the hidden SecurityManager static field
4 participants