-
Notifications
You must be signed in to change notification settings - Fork 6
Make *(one|zero) weights singletons #153
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes the implementation of several weight and transition function classes by enforcing the singleton pattern, ensuring that only a single instance (one or zero) exists. Key changes include making public constructors private, adding @nonnull annotations on parameters, and updating string representations in toString methods.
- TransitionFunctionZero.java & TransitionFunctionOne.java: Constructors changed to private to enforce singleton usage and NonNull annotations added where needed.
- PathConditionWeightOne.java, MinDistanceWeightOne.java, DataFlowPathWeightOne.java, SetDomainZero.java, SetDomainOne.java: Constructors made private in line with the singleton approach.
- MinDistanceWeightImpl.java: Simplified the toString method by removing an instantiation of the singleton weight.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
idealPDS/src/main/java/typestate/TransitionFunctionZero.java | Constructor changed to private to enforce singleton |
idealPDS/src/main/java/typestate/TransitionFunctionOne.java | Constructor made private and NonNull annotation added to extendWith parameter |
boomerangPDS/src/main/java/boomerang/weights/PathConditionWeightOne.java | Constructors changed to private to support singleton pattern |
boomerangPDS/src/main/java/boomerang/weights/MinDistanceWeightOne.java | Constructor made private to enforce singleton pattern |
boomerangPDS/src/main/java/boomerang/weights/MinDistanceWeightImpl.java | toString method updated to remove redundant weight instantiation |
boomerangPDS/src/main/java/boomerang/weights/DataFlowPathWeightOne.java | Constructor changed to private to enforce singleton |
SynchronizedPDS/src/main/java/sync/pds/weights/SetDomainZero.java | Constructor made private in line with singleton usage |
SynchronizedPDS/src/main/java/sync/pds/weights/SetDomainOne.java | Constructor made private to enforce the singleton design |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Close #150