Remove standalone SubProgressMonitor and done() removal from JFace cleanup#597
Merged
carstenartur merged 2 commits intoFeb 4, 2026
Conversation
… JFace cleanup Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove problematic features from JFace cleanup plugin
Remove standalone SubProgressMonitor and done() removal from JFace cleanup
Feb 4, 2026
carstenartur
added a commit
that referenced
this pull request
Feb 5, 2026
) * Implement SubProgressMonitor enhancements: standalone conversion, flag mapping, and documentation updates Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> * Fix standalone SubProgressMonitor detection and transformation - 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> * Address code review feedback: document limitations and add test coverage - 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> * Add done() call removal feature (partial implementation) - 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> * Fix done() removal - iterate through all holders to find matches 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> * Temporarily disable done() removal to fix test failures 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> * Fix standalone SubProgressMonitor conversion and done() removal in JFacePlugin (#590) * [WIP] Fix SubProgressMonitor to SubMonitor transformation regression (#593) * Plan: Fix JFace cleanup transformation not being applied Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> * Fix JFace cleanup: remove scope functions from SubProgressMonitor and 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> * [WIP] Fix variable declaration in JFacePlugin to resolve CI test failures (#595) * Restore scope functions to enable Block-level grouping of progress monitor 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> * Fix holder access in JFace cleanup and document pattern detection issue (#596) * Remove standalone SubProgressMonitor and done() removal from JFace cleanup (#597) * [WIP] Update expected output for JFace cleanup tests (#598) * Fix JFace cleanup idempotence tests - align given/expected for already-converted code (#599) * fix formatting --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> Co-authored-by: Carsten Hammer <carsten.hammer@t-online.de>
carstenartur
added a commit
that referenced
this pull request
Feb 5, 2026
) * Implement SubProgressMonitor enhancements: standalone conversion, flag mapping, and documentation updates Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> * Fix standalone SubProgressMonitor detection and transformation - 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> * Address code review feedback: document limitations and add test coverage - 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> * Add done() call removal feature (partial implementation) - 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> * Fix done() removal - iterate through all holders to find matches 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> * Temporarily disable done() removal to fix test failures 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> * Fix standalone SubProgressMonitor conversion and done() removal in JFacePlugin (#590) * [WIP] Fix SubProgressMonitor to SubMonitor transformation regression (#593) * Plan: Fix JFace cleanup transformation not being applied Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> * Fix JFace cleanup: remove scope functions from SubProgressMonitor and 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> * [WIP] Fix variable declaration in JFacePlugin to resolve CI test failures (#595) * Restore scope functions to enable Block-level grouping of progress monitor 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> * Fix holder access in JFace cleanup and document pattern detection issue (#596) * Remove standalone SubProgressMonitor and done() removal from JFace cleanup (#597) * [WIP] Update expected output for JFace cleanup tests (#598) * Fix JFace cleanup idempotence tests - align given/expected for already-converted code (#599) * Initial plan * Fix formatting in Java8CleanUpTest expected outputs - revert to match actual cleanup output Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com> Co-authored-by: Carsten Hammer <carsten.hammer@t-online.de>
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.
PR #568 introduced two features with scope issues in the
AstProcessorBuilder/ReferenceHolderpattern: visitors don't share holder data acrossBlockboundaries, breaking standaloneSubProgressMonitordetection anddone()call tracking.Changes
Removed from
JFacePlugin.java:MonitorHolderfields:isStandalone,doneInvocations,subMonitorVarNameSubProgressMonitorvisitor logic and post-processing loopdone()method invocation visitor and removal logic inrewrite()Removed test cases:
StandaloneSubProgressMonitorStandaloneSubProgressMonitorWithFlagsDoneCallRemovalMultipleDoneCallsDocumentation:
beginTask + SubProgressMonitorpatternsRetained Functionality
Core transformation remains intact:
beginTask + SubProgressMonitor→SubMonitor.convert + splitSUPPRESS_SUBTASK_LABEL→SUPPRESS_SUBTASK)Net: -270 lines, stable for merge. Removed features can be revisited after addressing holder pattern limitations.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.eclipse.org/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/sandbox/sandbox org.codehaus.plexus.classworlds.launcher.Launcher verify -DskipTests -T 1C(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.