From af674d9d57ce74bf36488040fcf606bdf5ac6b0e Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 10 May 2019 22:24:40 +0200 Subject: [PATCH] [ui] drops incorrect AWT exception fix GitOrigin-RevId: 4dc89580f66d6dad0d51c0822a013eaa7eea62d0 --- .../openapi/application/ex/ClipboardUtil.java | 33 ++----------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/application/ex/ClipboardUtil.java b/platform/platform-impl/src/com/intellij/openapi/application/ex/ClipboardUtil.java index 64806cf89b64..5e4bdfb0570d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/ex/ClipboardUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/ex/ClipboardUtil.java @@ -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 handleClipboardSafely(@NotNull Supplier supplier, @NotNull Supplier 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 useLegacyMergeSort(Supplier 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);