Skip to content

Issue #12671: Kill mutation for finalLocalVariable#13184

Closed
Kevin222004 wants to merge 1 commit intocheckstyle:masterfrom
Kevin222004:FLC1
Closed

Issue #12671: Kill mutation for finalLocalVariable#13184
Kevin222004 wants to merge 1 commit intocheckstyle:masterfrom
Kevin222004:FLC1

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 8, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 8, 2023

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5214184671

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 9, 2023

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5223346849

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5375985181

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 1, 2023

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5430072516

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 4, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 4, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 4, 2023

@nrmancuso
Copy link
Copy Markdown
Contributor

@Kevin222004 what do we need to do to get this PR out of draft mode?

@romani
Copy link
Copy Markdown
Member

romani commented Sep 27, 2023

rebased and conflict is resolved we will move forward with removal of code as we see that diff report finds nothing.

@romani romani marked this pull request as ready for review September 27, 2023 13:31
@romani romani self-assigned this Sep 27, 2023
@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Sep 27, 2023

I would be extremely careful removing this type of code.

We are removing items from the array on a leave token in this code. This code is the only time we remove items from the array. This means we are always adding to the array, so every method, every inner class is being collected together into this one array. We have seen weird issues before because of this type of behavior and code type. If you want my approval, I would want proof that this won't harm us.

I am not seeing a reset on this variable on a new file, so it seems we are even collecting items across multiple files basically making this a multi-file check it it is true.

@romani
Copy link
Copy Markdown
Member

romani commented Sep 27, 2023

CI job for no exceptions is failing with Caused by: java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects that contribute to same reason as described above, as collection is growing.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Sep 27, 2023

Tests like testFinalLocalVariableSwitchAssignment leak data after the file is run.

prevScopeUninitializedVariables: [[res[92x15]], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]

It is the handling of the EXPR token and the difference between visit and leave which is leading to the uncleared data. They don't match up exactly. This isn't causing any issues right now most likely because we are dealing with ASTs and the code only currently does a == check on 2 separate instances of the AST, which will never match up unless they are from the same file. Different files, or even different AST generation runs, will have different AST instances.

I did a difference run with new code clearing the fields and it produced no differences.

In addition, we run Checkstyle twice during our tests. Once during verify(Checker checker, File[] processedFiles, Map<String, List<String>> expectedViolations) and the second during getActualViolationsForFile(Configuration config, String file) throws Exception.

@romani
Copy link
Copy Markdown
Member

romani commented Sep 28, 2023

@rdiachenko , please help to crack this heavy puzzle.

@rdiachenko
Copy link
Copy Markdown
Member

Resolved by #13814

@rdiachenko rdiachenko closed this Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants