From 70d39ca07c09afae69e39a72e88bdd8d1c3be9d5 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Thu, 11 Jun 2020 18:19:16 +0300 Subject: [PATCH] [git] migration to Java 11: use explicit 'setUI' call instead of 'ui' property ...to fix "Val cannot be reassigned" error when compiling IntelliJ sources under Java 11 (see KT-31926). GitOrigin-RevId: 4199c5c8944e2f320f5fcd7019e47f92cc50de45 --- plugins/git4idea/src/git4idea/merge/GitMergeDialog.kt | 6 +++--- plugins/git4idea/src/git4idea/pull/GitPullDialog.kt | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeDialog.kt b/plugins/git4idea/src/git4idea/merge/GitMergeDialog.kt index 4df1f77017d9..f4703643cd00 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeDialog.kt +++ b/plugins/git4idea/src/git4idea/merge/GitMergeDialog.kt @@ -252,7 +252,7 @@ class GitMergeDialog(private val project: Project, isSwingPopup = false val bw = DarculaUIUtil.BW.get() - ui = FlatComboBoxUI(outerInsets = Insets(bw, bw, bw, 0)) + setUI(FlatComboBoxUI(outerInsets = Insets(bw, bw, bw, 0))) addItemListener { e -> if (e.stateChange == ItemEvent.SELECTED @@ -276,9 +276,9 @@ class GitMergeDialog(private val project: Project, val bw = DarculaUIUtil.BW.get() - ui = FlatComboBoxUI( + setUI(FlatComboBoxUI( outerInsets = Insets(bw, 0, bw, bw), - popupEmptyText = GitBundle.message("merge.branch.popup.empty.text")) + popupEmptyText = GitBundle.message("merge.branch.popup.empty.text"))) } } diff --git a/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt b/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt index 0fe3b68a09f5..2a9e6b200b46 100644 --- a/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt +++ b/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt @@ -306,7 +306,7 @@ class GitPullDialog(private val project: Project, private fun createRepositoryField() = ComboBox(CollectionComboBoxModel(repositories)).apply { isSwingPopup = false renderer = SimpleListCellRenderer.create("") { DvcsUtil.getShortRepositoryName(it) } - ui = FlatComboBoxUI(outerInsets = Insets(1, 1, 1, 0)) + setUI(FlatComboBoxUI(outerInsets = Insets(1, 1, 1, 0))) item = repositories.find { repo -> repo.root == defaultRoot } @@ -320,9 +320,9 @@ class GitPullDialog(private val project: Project, isSwingPopup = false renderer = SimpleListCellRenderer.create(GitBundle.message("util.remote.renderer.none")) { it.name } val bw = DarculaUIUtil.BW.get() - ui = FlatComboBoxUI( + setUI(FlatComboBoxUI( outerInsets = Insets(bw, 0, bw, 0), - popupEmptyText = GitBundle.message("pull.branch.no.matching.remotes")) + popupEmptyText = GitBundle.message("pull.branch.no.matching.remotes"))) item = getCurrentOrDefaultRemote(getRepository()) @@ -338,9 +338,9 @@ class GitPullDialog(private val project: Project, isEditable = true val bw = DarculaUIUtil.BW.get() - ui = FlatComboBoxUI( + setUI(FlatComboBoxUI( Insets(1, 0, 1, 1), Insets(bw, 0, bw, bw), - GitBundle.message("pull.branch.nothing.to.pull")) + GitBundle.message("pull.branch.nothing.to.pull"))) } } \ No newline at end of file