-
Notifications
You must be signed in to change notification settings - Fork 27
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
Removal of Triple, and Quadruple #3529
Conversation
325d25b
to
0eec2d4
Compare
130c4c3
to
f658d4f
Compare
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.
Thanks! In my opinion, it is a very good idea to remove these two classes, and use records with good names instead.
I only have some minor remarks:
- In some comments, "first" and "second" have been replaced too aggressively ...
- Some uses of var should be removed in my opinion.
- Some record parameters could use better names instead of "first", "second", ...
key.core/src/main/java/de/uka/ilkd/key/proof/io/AbstractProblemLoader.java
Show resolved
Hide resolved
...c_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/rule/AbstractSideProofRule.java
Show resolved
Hide resolved
key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java
Outdated
Show resolved
Hide resolved
key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java
Outdated
Show resolved
Hide resolved
key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java
Outdated
Show resolved
Hide resolved
key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java
Outdated
Show resolved
Hide resolved
key.core/src/main/java/de/uka/ilkd/key/rule/merge/procedures/MergeByIfThenElse.java
Outdated
Show resolved
Hide resolved
key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java
Outdated
Show resolved
Hide resolved
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.
Thanks! Apart from the spotless formatting, I think it is fine now.
4713b8e
to
7c41529
Compare
Quality Gate passedIssues Measures |
Refactoring
This PR starts the removal of generic data classes in favor of Java records (aka. named tuples). In this PR, only
Triple
andQuadruple
are removed.In general, generic parametric data classes (
Tuple
,Union
, ...) lead to unreadable, incomprehensible code, e.g., what does the entityTriple<StatementBlock, URI, Integer>
express? Answer: It is the key in a map to find block contracts. Using the recordBlockContractKey
expresses this better than triple of something.Therefore, records give you the chance of defining useful variable names, and documentation, and also avoid auto-boxing (hence NPE).
Intended Change
No use of
Triple<…>
andQuadruple<…>
.Type of pull request
Ensuring quality