Prevent IllegalStateException: Should not acquire Children.MUTEX while holding ProjectManager.mutex()
authorJulien Enselme <jenselme@netbeans.org>
Tue, 16 Feb 2016 17:40:36 +0100
changeset 18362a444ba39f969
parent 18361 049ffcf2a3aa
child 18363 cb2b35194c5c
Prevent IllegalStateException: Should not acquire Children.MUTEX while holding ProjectManager.mutex()
python.project2/src/org/netbeans/modules/python/project2/ui/ImportantFiles.java
     1.1 --- a/python.project2/src/org/netbeans/modules/python/project2/ui/ImportantFiles.java	Thu Jan 14 18:37:20 2016 +0100
     1.2 +++ b/python.project2/src/org/netbeans/modules/python/project2/ui/ImportantFiles.java	Tue Feb 16 17:40:36 2016 +0100
     1.3 @@ -62,6 +62,7 @@
     1.4  import org.netbeans.api.annotations.common.NonNull;
     1.5  import org.netbeans.api.annotations.common.StaticResource;
     1.6  import org.netbeans.api.project.Project;
     1.7 +import org.netbeans.api.project.ProjectManager;
     1.8  import org.netbeans.modules.python.project2.ImportantFilesImplementation;
     1.9  import org.netbeans.spi.project.ui.support.NodeFactory;
    1.10  import org.netbeans.spi.project.ui.support.NodeList;
    1.11 @@ -317,7 +318,9 @@
    1.12          private void setKeys() {
    1.13              List<ImportantFilesImplementation.FileInfo> importantFiles = getImportantFiles();
    1.14              Collections.sort(importantFiles, new FileInfoComparator());
    1.15 -            setKeys(importantFiles);
    1.16 +            if (!ProjectManager.mutex().isReadAccess() && !ProjectManager.mutex().isWriteAccess()) {
    1.17 +                setKeys(importantFiles);
    1.18 +            }
    1.19          }
    1.20  
    1.21          private List<ImportantFilesImplementation.FileInfo> getImportantFiles() {