[platform] migration to Java 11: adapt code to changes in Swing API (IDEA-241075)
authorNikolay Chashnikov <Nikolay.Chashnikov@jetbrains.com>
Tue, 16 Jun 2020 12:12:21 +0000 (15:12 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 11 Aug 2020 17:11:22 +0000 (17:11 +0000)
GitOrigin-RevId: 6ce8f5e200f5dc8f00344d909d1a85721de98a98

platform/platform-impl/src/com/intellij/ui/colorpicker/ColorAdjustPanel.kt

index ee3b7f97900bcf76cb8f83a38ff5a0fb00804dd0..0a4a2ffd58cb636ef77c0a4ff43a74b852e93aec 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+@file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE")
 package com.intellij.ui.colorpicker
 
 import com.google.common.annotations.VisibleForTesting
 import com.intellij.openapi.wm.WindowManager
 import com.intellij.ui.picker.ColorListener
 import com.intellij.util.ui.JBUI
+import sun.awt.AWTPermissions
 import java.awt.*
 import javax.swing.BoxLayout
 import javax.swing.JPanel
@@ -161,7 +163,7 @@ private fun canPickupColorFromDisplay(): Boolean {
   }
 
   return try {
-    System.getSecurityManager()?.checkPermission(AWTPermission("readDisplayPixels"))
+    System.getSecurityManager()?.checkPermission(AWTPermissions.READ_DISPLAY_PIXELS_PERMISSION)
     true
   }
   catch (e: SecurityException) {