[ui] drops incorrect AWT exception fix

GitOrigin-RevId: 4dc89580f66d6dad0d51c0822a013eaa7eea62d0
This commit is contained in:
Roman Shevchenko
2019-05-11 00:05:26 +03:00
committed by intellij-monorepo-bot
parent e257cf0dd8
commit af674d9d57
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package com.intellij.openapi.application.ex;
import com.intellij.openapi.diagnostic.Logger;
@@ -29,7 +15,7 @@ public class ClipboardUtil {
public static <E> E handleClipboardSafely(@NotNull Supplier<? extends E> supplier, @NotNull Supplier<? extends E> onFail) {
try {
return useLegacyMergeSort(supplier);
return supplier.get();
}
catch (IllegalStateException e) {
if (SystemInfo.isWindows) {
@@ -48,21 +34,6 @@ public class ClipboardUtil {
return onFail.get();
}
private static final String USE_LEGACY_MERGE_SORT_PROPERTY_NAME = "java.util.Arrays.useLegacyMergeSort";
private static <T> T useLegacyMergeSort(Supplier<T> supplier) {
String originalValue = System.getProperty(USE_LEGACY_MERGE_SORT_PROPERTY_NAME);
System.setProperty(USE_LEGACY_MERGE_SORT_PROPERTY_NAME, "true");
try {
return supplier.get();
}
finally {
if (originalValue != null) {
System.setProperty(USE_LEGACY_MERGE_SORT_PROPERTY_NAME, originalValue);
}
}
}
@Nullable
public static String getTextInClipboard() {
return CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor);