Skip to content

Applying Java 17 refactorings#3252

Merged
wadoon merged 7 commits into
mainfrom
weigl/java17-cleanup
Aug 22, 2023
Merged

Applying Java 17 refactorings#3252
wadoon merged 7 commits into
mainfrom
weigl/java17-cleanup

Conversation

@wadoon
Copy link
Copy Markdown
Member

@wadoon wadoon commented Aug 20, 2023

Applies refactorings after the switch to Java 17 for after #3241.

Including:

  • Transform immutable data classes to Java records
  • Rewrite instanceof and casts to Pattern expressions
  • Use .toList() instead of .collect(Collectors.toList)
  • Use Text Block Literals (""" ... """) on large strings instead of concatenation cascades.

@wadoon wadoon changed the title Applying Java1 refactorings Applying Java 17 refactorings Aug 20, 2023
@wadoon wadoon added this to the v2.14.0 milestone Aug 20, 2023
@wadoon wadoon added the 🛠 Maintenance Code quality and related things w/o functional changes label Aug 20, 2023
@wadoon wadoon self-assigned this Aug 20, 2023
@wadoon wadoon requested a review from WolframPfeifer August 20, 2023 14:51
@wadoon wadoon marked this pull request as ready for review August 20, 2023 14:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 20, 2023

Codecov Report

Merging #3252 (26c0d78) into main (899ae9a) will decrease coverage by 0.02%.
The diff coverage is 30.68%.

@@             Coverage Diff              @@
##               main    #3252      +/-   ##
============================================
- Coverage     37.75%   37.73%   -0.02%     
+ Complexity    16872    16851      -21     
============================================
  Files          2053     2052       -1     
  Lines        126504   125687     -817     
  Branches      21263    21234      -29     
============================================
- Hits          47764    47432     -332     
+ Misses        72893    72412     -481     
+ Partials       5847     5843       -4     
Files Changed Coverage Δ
.../main/java/de/uka/ilkd/key/testgen/Assignment.java 0.00% <0.00%> (ø)
...c/main/java/de/uka/ilkd/key/testgen/ProofInfo.java 0.00% <0.00%> (ø)
...ava/de/uka/ilkd/key/testgen/TestCaseGenerator.java 0.00% <0.00%> (ø)
...e/uka/ilkd/key/testgen/oracle/OracleGenerator.java 0.00% <0.00%> (ø)
.../key/testgen/oracle/OracleInvariantTranslator.java 0.00% <0.00%> (ø)
...de/uka/ilkd/key/testgen/oracle/OracleLocation.java 0.00% <0.00%> (ø)
...a/de/uka/ilkd/key/testgen/oracle/OracleMethod.java 0.00% <0.00%> (ø)
...ava/de/uka/ilkd/key/testgen/oracle/OracleType.java 0.00% <0.00%> (ø)
...e/uka/ilkd/key/testgen/oracle/OracleUnaryTerm.java 0.00% <0.00%> (ø)
...de/uka/ilkd/key/testgen/oracle/OracleVariable.java 0.00% <0.00%> (ø)
... and 237 more

... and 98 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 20, 2023

Thank you for your contribution.

The test artifacts are available on Artiweb.
The newest artifact is here.

@wadoon wadoon enabled auto-merge August 21, 2023 09:27
@wadoon wadoon force-pushed the weigl/java17-cleanup branch from cbf036a to 69c3516 Compare August 21, 2023 22:08
@wadoon wadoon force-pushed the weigl/java17-cleanup branch from 69c3516 to 8dd8db2 Compare August 21, 2023 22:16
@WolframPfeifer
Copy link
Copy Markdown
Member

The missing space when using instanceof (e.g. if (t.op()instanceof ProgramVariable var) {) with method calls/arrays was indeed a bug in the Eclipse formatter: https://bugs.eclipse.org/bugs/show_bug.cgi?id=574437
I fixed it by upgrading the spotless version and thus also the formatter.

However, I had to fix the formatter version to 4.22, since more recent versions have another bug, such that it crashes while trying to format our SymbolicExecutionTreeBuilder class.

@wadoon wadoon added this pull request to the merge queue Aug 22, 2023
Merged via the queue into main with commit 6c808a3 Aug 22, 2023
@wadoon wadoon deleted the weigl/java17-cleanup branch August 22, 2023 20:15
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