Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize default VM management to avoid unnecessary project updates #1484

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

fbricon
Copy link
Contributor

@fbricon fbricon commented Jun 16, 2020

With the previous code, the java.home was initially prepared to be used as default VM, even though there was a default runtime set, potentially triggering unnecessary full builds

@fbricon fbricon requested a review from snjeza June 16, 2020 23:52
vmStandin.setInstallLocation(jvmHome);
vm = vmStandin.convertToRealVM();
JDTUtils.setCompatibleVMs(vm.getId());
changed = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this caused full builds even though there was already a default runtime environment

@snjeza
Copy link
Contributor

snjeza commented Jun 17, 2020

@fbricon could you try to apply the following patch:

diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
index 2909c4bf..fa1087fb 100644
--- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
+++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleProjectImporter.java
@@ -276,7 +276,7 @@ public class GradleProjectImporter extends AbstractProjectImporter {
        }
 
        private static boolean checkGradlePersistence(boolean shouldSynchronize, IProject project, File projectDir) {
-               if (!ProjectUtils.isJavaProject(project) || !project.getFile(IJavaProject.CLASSPATH_FILE_NAME).exists()) {
+               if (ProjectUtils.isJavaProject(project) && !project.getFile(IJavaProject.CLASSPATH_FILE_NAME).exists()) {
                        return true;
                }
                PersistentModel model = CorePlugin.modelPersistence().loadModel(project);

@fbricon fbricon added this to the Mid June 2020 milestone Jun 17, 2020
@fbricon fbricon marked this pull request as ready for review June 17, 2020 16:40
@fbricon fbricon merged commit 5bebe70 into master Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants