From d426fa86dfe46ca9fb6aa2ffc3617b666cb4667f Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Wed, 2 Mar 2011 16:02:43 +0300 Subject: [PATCH] explicit no read access assert --- .../intellij/openapi/fileTypes/impl/NativeFileIconProvider.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java index 4267082afea5..03f707e51b14 100644 --- a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java +++ b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java @@ -17,6 +17,7 @@ package com.intellij.openapi.fileTypes.impl; import com.intellij.ide.FileIconProvider; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.vfs.VirtualFile; @@ -68,6 +69,7 @@ public class NativeFileIconProvider implements FileIconProvider { } Icon icon; try { // VM will ensure lock to init -static final field--, note we should have no read access here, to avoid deadlock with EDT needed to init component + assert !ApplicationManager.getApplication().isReadAccessAllowed(); icon = SwingComponentHolder.ourFileChooser.getIcon(f); } catch (Exception e) { // see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4854174