Fix JFace test expected outputs to match actual cleanup formatting#602
Merged
Conversation
…g mapping, and documentation updates Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
- Refactored find() method to collect all SubProgressMonitor instances first - Added post-processing to identify standalone monitors (not associated with beginTask) - Create separate operations for standalone monitors - Removed debug statements - This should fix the CI test failure for StandaloneSubProgressMonitor test case Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
- Added test case for standalone SubProgressMonitor with flags (shows flags are dropped) - Updated README.md to document flag dropping behavior for standalone cases - Added documentation about bitwise OR limitation in flag mapping - Improved inline comments to clarify flag handling - Fixed duplicate comment in mapSubProgressMonitorFlags method Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
- Added doneInvocations tracking to MonitorHolder - Implemented done() call visitor in find() method - Added removal logic in rewrite() method - Added DoneCallRemoval and MultipleDoneCalls test cases - Updated README: added feature to Key Features, added example, removed limitation - Tests show feature is detected but removal not yet working correctly Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
The previous implementation only checked the last holder, which missed done() calls. Now searches through all MonitorHolders to properly associate done() calls with their corresponding beginTask transformations. Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
The done() removal feature is causing 14 out of 16 tests to fail. Disabling it temporarily to restore functionality while investigating the root cause of the failures. The infrastructure (doneInvocations tracking) remains in place for future re-enablement once the issue is resolved. Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
… done() visitors The ClassInstanceCreation and done() method visitors had scope functions that prevented them from accessing the holders created by the beginTask visitor. When multiple visitors use different scope functions, they get separate holder instances and can't share data. Removed the scope functions from: 1. callClassInstanceCreationVisitor for SubProgressMonitor detection 2. callMethodInvocationVisitor for done() call detection This allows these visitors to access the global holder populated by beginTask visitor, enabling proper SubProgressMonitor transformation. Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
…nitor elements The scope functions `s -> ASTNodes.getTypedAncestor(s, Block.class)` are intentional and necessary. They group related progress monitor elements (beginTask, SubProgressMonitor, done) that belong together within the same Block scope. Restored scope functions to: - callClassInstanceCreationVisitor for SubProgressMonitor detection - callMethodInvocationVisitor for done() call detection This ensures all three visitors (beginTask, SubProgressMonitor, done) operate on the same Block-scoped holder, allowing proper matching of related monitor operations. Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
…y-converted code (#599)
… actual cleanup output Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix formatting inconsistencies in Java8CleanUpTest
Fix JFace test expected outputs to match actual cleanup formatting
Feb 4, 2026
Base automatically changed from
copilot/cleanup-subprogressmonitor-usage
to
main
February 5, 2026 18:33
Contributor
JUnit Test Overview ReportGenerated on: 21723855786 Overall Statistics
Test Summary by Plugin
Disabled Tests Detailssandbox_functional_converter_test (44 disabled)
sandbox_junit_cleanup_test (34 disabled)
sandbox_platform_helper_test (1 disabled)
This report is automatically generated by the Test Report workflow |
Contributor
Contributor
✅ All Tests PassedNo test failures detected. This comment is automatically updated with test failure details for each commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test expected outputs in
Java8CleanUpTest.javahad incorrect whitespace - spaces around=and after commas that the JFace cleanup never produces.Changes
Reverted all expected output formatting in
JFaceCleanupCasesenum (11 test cases) to match actual cleanup behavior:Pattern corrections:
SubMonitor subMonitor = SubMonitor.convert(monitor, task, 100)→SubMonitor subMonitor=SubMonitor.convert(monitor,task,100)IProgressMonitor sub = subMonitor.split(50)→IProgressMonitor sub= subMonitor.split(50)Example:
Affected test cases: PositiveCase, Twice, WithFlags, UniqueVariableName, IdempotenceAlreadyConverted, MixedStateOneConvertedOneNot, NestedInnerClass, LambdaScenario, SuppressSubtaskLabelFlag, PrependMainLabelToSubtaskFlag, BothImportsCoexist.
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.