[vcs] get rid of references to package-private members of intellij.platform.vcs.core from intellij.platform.vcs (IJPL-149126)

A new public constructor is added to the 'Change' class to avoid using a protected method not from its subclass.

GitOrigin-RevId: 388399ed29a05410a0892352e03a2b658d8e1e6e
This commit is contained in:
Nikolay Chashnikov
2025-04-30 09:01:10 +00:00
committed by intellij-monorepo-bot
parent 2bfdcf5451
commit 17b78c82d8
3 changed files with 11 additions and 9 deletions
-2
View File
@@ -4014,7 +4014,6 @@
<module name="intellij.platform.projectModel.impl" />
<module name="intellij.platform.analysis" />
<module name="intellij.platform.analysis.impl" />
<module name="intellij.platform.vcs" />
<module name="intellij.platform.editor" />
<module name="intellij.platform.util.rt" />
<module name="intellij.treeProjectModel.ide" />
@@ -4023,7 +4022,6 @@
<module name="intellij.platform.indexing.impl" />
<module name="intellij.javaee.testFramework" />
<module name="intellij.platform.jps.model" />
<module name="intellij.platform.vcs.core" />
<module name="intellij.platform.main" />
<module name="intellij.platform.diff.impl" />
<module name="intellij.platform.testFramework.core" />
@@ -52,9 +52,7 @@ class ChangeListChange(
change.changeListId)
}
else {
return Change(bRev, aRev, change.fileStatus).also {
it.copyFieldsFrom(change)
}
return Change(bRev, aRev, change.fileStatus, change)
}
}
}
@@ -10,10 +10,7 @@ import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vcs.impl.VcsPathPresenter;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;
import javax.swing.*;
import java.io.File;
@@ -55,6 +52,15 @@ public class Change {
myAfterRevision = afterRevision;
myFileStatus = fileStatus == null ? convertStatus(beforeRevision, afterRevision) : fileStatus;
}
@ApiStatus.Internal
public Change(@Nullable ContentRevision beforeRevision,
@Nullable ContentRevision afterRevision,
@Nullable FileStatus fileStatus,
@NotNull Change change) {
this(beforeRevision, afterRevision, fileStatus);
copyFieldsFrom(change);
}
protected void copyFieldsFrom(@NotNull Change change) {
myOtherLayers = change.myOtherLayers != null ? new HashMap<>(change.myOtherLayers) : null;