fix compilation

GitOrigin-RevId: 25bb0ac92e86b52c7a81962517b62ee5e6ffc4f1
This commit is contained in:
Kirill Likhodedov
2023-12-18 20:18:58 +01:00
committed by intellij-monorepo-bot
parent 1997641071
commit cc6dbbc94e
2 changed files with 4 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ui;
import com.intellij.openapi.util.NlsContexts;
@@ -9,7 +9,6 @@ import com.intellij.util.Function;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import sun.swing.DefaultLookup;
import javax.swing.*;
@@ -24,7 +23,7 @@ import java.awt.*;
* @author gregsh
*/
public abstract class SimpleListCellRenderer<T> extends JBLabel implements ListCellRenderer<T> {
public static @NotNull <T> SimpleListCellRenderer<@Nullable T> create(@NotNull @NlsContexts.Label String nullValue,
public static @NotNull <T> SimpleListCellRenderer<T> create(@NotNull @NlsContexts.Label String nullValue,
@NotNull Function<? super T, @NlsContexts.Label String> getText) {
return new SimpleListCellRenderer<>() {
@Override

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.vcs.configurable
import com.intellij.ide.impl.isTrusted
@@ -470,7 +470,7 @@ class VcsDirectoryConfigurationPanel(private val project: Project) : JPanel(), D
private fun buildVcsesComboBox(allVcses: List<AbstractVcs>): ComboBox<AbstractVcs?> {
val comboBox = ComboBox((allVcses + null).toTypedArray())
comboBox.renderer = SimpleListCellRenderer.create(VcsBundle.message("none.vcs.presentation")) { obj: AbstractVcs -> obj.displayName }
comboBox.renderer = SimpleListCellRenderer.create(VcsBundle.message("none.vcs.presentation")) { obj: AbstractVcs? -> obj?.displayName }
return comboBox
}
}