IDEA-329792 [Gradle|Sync] fix: returned old filed for the migration of the java toolchain home

Source set is serialized with the data nodes storage. So we need to migrate old data.

GitOrigin-RevId: 0512049a8436225e8e7e8602ae6862710144de89
This commit is contained in:
Sergei Vorobyov
2024-03-29 14:21:02 +00:00
committed by intellij-monorepo-bot
parent 35a2d5872e
commit 2fee407cf3
@@ -19,6 +19,9 @@ public final class DefaultExternalSourceSet implements ExternalSourceSet {
private boolean isPreview;
private String sourceCompatibility;
private String targetCompatibility;
// The jdkInstallationPath exists only for migration.
// Source sets are serialized with the project data nodes.
private String jdkInstallationPath;
private File javaToolchainHome;
private Collection<File> artifacts;
private @NotNull Collection<ExternalDependency> dependencies;
@@ -80,10 +83,15 @@ public final class DefaultExternalSourceSet implements ExternalSourceSet {
@Override
public @Nullable File getJavaToolchainHome() {
if (jdkInstallationPath != null) {
javaToolchainHome = new File(jdkInstallationPath);
jdkInstallationPath = null;
}
return javaToolchainHome;
}
public void setJavaToolchainHome(@Nullable File javaToolchainHome) {
this.jdkInstallationPath = null;
this.javaToolchainHome = javaToolchainHome;
}