key icon indicating copy to clipboard operation
key copied to clipboard

Removal of Triple, and Quadruple

Open wadoon opened this issue 1 year ago • 1 comments

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 avatar Feb 11 '24 20:02 wadoon