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

Removal of Triple, and Quadruple #3399

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

wadoon
Copy link
Member

@wadoon wadoon commented Feb 11, 2024

Refactoring

This PR starts the removal of generic data classes in favor of Java records (aka. named tuples). In this PR, only Triple and Quadruple are removed.

In general, generic parametric data classes (Tuple, Union, ...) lead to unreadable, incomprehensible code, e.g., what does the entity Triple<StatementBlock, URI, Integer> express? Answer: It is the key in a map to find block contracts. Using the record BlockContractKey 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<…> and Quadruple<…>.

Type of pull request

  • X Refactoring (behaviour should not change or only minimally change)
  • X There are changes to the (Java) code

Ensuring quality

  • X by TEST CASES!!! and compiler

@wadoon wadoon self-assigned this Feb 16, 2024
jml_classlevel.txt Outdated Show resolved Hide resolved
@wadoon wadoon changed the title Removal of Pair, Triple, and Quadruple Removal of Triple, and Quadruple Apr 23, 2024
@wadoon wadoon requested a review from mattulbrich April 23, 2024 20:16
@wadoon wadoon marked this pull request as ready for review April 23, 2024 20:32
@wadoon wadoon added the 🛠 Maintenance Code quality and related things w/o functional changes label Apr 23, 2024
@wadoon wadoon added this to the v2.14.0 milestone Apr 23, 2024
@wadoon wadoon enabled auto-merge April 23, 2024 20:36
Copy link

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 44.55959% with 107 lines in your changes missing coverage. Please review.

Project coverage is 38.16%. Comparing base (0ebb8b5) to head (2eae40e).
Report is 3 commits behind head on main.

Files Patch % Lines
.../java/de/uka/ilkd/key/rule/WhileInvariantRule.java 17.14% 29 Missing ⚠️
...g/key_project/slicing/ui/RuleStatisticsDialog.java 0.00% 23 Missing ⚠️
...org/key_project/slicing/ui/ShowNodeInfoAction.java 0.00% 9 Missing ⚠️
...d/key/speclang/jml/translation/JMLSpecFactory.java 12.50% 5 Missing and 2 partials ⚠️
...ka/ilkd/key/proof/mgt/SpecificationRepository.java 66.66% 6 Missing ⚠️
...org/key_project/slicing/graph/DependencyGraph.java 60.00% 6 Missing ⚠️
...n/java/org/key_project/slicing/RuleStatistics.java 68.75% 5 Missing ⚠️
...java/de/uka/ilkd/key/speclang/ContractFactory.java 0.00% 4 Missing ⚠️
...trategy/definition/StrategySettingsDefinition.java 0.00% 4 Missing ⚠️
...l/mergerule/SymbolicExecutionStateWithProgCnt.java 33.33% 4 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #3399   +/-   ##
=========================================
  Coverage     38.16%   38.16%           
+ Complexity    17222    17220    -2     
=========================================
  Files          2109     2109           
  Lines        127643   127624   -19     
  Branches      21458    21456    -2     
=========================================
- Hits          48710    48706    -4     
+ Misses        72943    72932   -11     
+ Partials       5990     5986    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

wadoon and others added 2 commits June 26, 2024 18:25
* main: (77 commits)
  Update key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java
  spotless
  update oracle for taclet equality test
  change gradle github action to new syntax
  adding comments to jml spec factory default contracts
  repair soundness of assignment2UpdateRules with checked overflows
  spotless
  EQ version of seqSwapPreservesSeqPerm + proof
  added rule for sequences: swap preserves perm
  Changed types in replacement map for WD taclets, since PR KeYProject#3436 made casting TermSV to ProgramVariable not applicable
  spotlessing ...
  making RuleCommand work if already fully instantiated
  RuleCommand can now deal with rules that have schema variables for logical variables.
  Fix loading of taclet proof obligations (issue KeYProject#3477) * This commit fixes an NPE when loading * This commit fixes missing or inconsistent selection of loaded proof   obligation
  Code clean up (remove unused method)
  Fix loading of closed proofs (GUI threw error)
  Fix and test goToNext()
  Fix goToNextSibling() (thx Tobias)
  Format
  Add comments and next() method
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 Maintenance Code quality and related things w/o functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants