Duplicate recompilation fixed for .class files#505
Open
sajeerzeji wants to merge 2 commits intoOpenLiberty:mainfrom
Open
Duplicate recompilation fixed for .class files#505sajeerzeji wants to merge 2 commits intoOpenLiberty:mainfrom
sajeerzeji wants to merge 2 commits intoOpenLiberty:mainfrom
Conversation
venmanyarun
requested changes
Apr 6, 2026
Contributor
venmanyarun
left a comment
There was a problem hiding this comment.
Please create PR's for ci.maven and ci.gradle with updated tests to make sure integration-tests are working fine
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.
Fixes an issue mentioned in the comments of Maven:#752, where the issue was about the processFileChanges() was being called multiple times for the same .properties file when modifying in dev mode, but that is working correctly now, but I found an issue that is processFileChanges() is getting called twice for .class files when we change Java sources in dev mode.
When a .java file changes, the plugin queues it for compilation in the recompileJavaSources list. After a timeout, the plugin compiles the .java file into a .class file. Liberty then detects this .class file change and hot reloads the application.
The problem was that the .java file remained in the recompileJavaSources queue even after being compiled. This caused the plugin to compile the same .java file a second time, creating duplicate work and triggering unnecessary file change events.
The fix detects when Liberty has successfully hot reloaded by checking if the Application Update message count increased. If it has reloaded, we clear the recompileJavaSources list to prevent the plugin from compiling the same .java files again. This eliminates the duplicate compilation thus the processFileChanges() will be called only once.