[ 
https://issues.apache.org/jira/browse/NETBEANS-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17189716#comment-17189716
 ] 

Ernie Rael commented on NETBEANS-4696:
--------------------------------------

For the knockout side I've got

{code}
$ hg diff
diff --git 
a/webcommon/javascript2.knockout/src/org/netbeans/modules/javascript2/knockout/index/KnockoutIndex.java
 
b/webcommon/javascript2.knockout/src/org/netbeans/modules/javascript2/knockout/index/KnockoutIndex.java
--- 
a/webcommon/javascript2.knockout/src/org/netbeans/modules/javascript2/knockout/index/KnockoutIndex.java
+++ 
b/webcommon/javascript2.knockout/src/org/netbeans/modules/javascript2/knockout/index/KnockoutIndex.java
@@ -45,7 +45,6 @@

     private static final Map<Project, KnockoutIndex> INDEXES = new 
WeakHashMap<>();
     private final QuerySupport querySupport;
-    private static boolean areProjectsOpen = false;

     public static KnockoutIndex get(Project project) throws IOException {
         if (project == null) {
@@ -54,16 +53,8 @@
         synchronized (INDEXES) {
             KnockoutIndex index = INDEXES.get(project);
             if (index == null) {
-                if (!areProjectsOpen) {
-                    try {
-                        // just be sure that the projects are open
-                        OpenProjects.getDefault().openProjects().get();
-                    } catch (InterruptedException | ExecutionException ex) {
-                        Exceptions.printStackTrace(ex);
-                    } finally {
-                        areProjectsOpen = true;
-                    }
-                }
+                if(!OpenProjects.getDefault().openProjects().isDone())
+                    return null;
                 Collection<FileObject> sourceRoots = 
QuerySupport.findRoots(project,
                         null /* all source roots */,
                         Collections.<String>emptyList(),
{code}

FindUsage shows that all callers of "...get(project)" check for a null return. 
Looking at the call sites, it doesn't seem like anything is cached; it seems 
like it should come back next time it wants info. But I couldn't get a 
breakpoint at the "return null", so who knows.

Comments? Just try it?

> NetBeans 12.1-beta1 sometimes hangs on open
> -------------------------------------------
>
>                 Key: NETBEANS-4696
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-4696
>             Project: NetBeans
>          Issue Type: Bug
>          Components: ide - Performance
>    Affects Versions: 12.1
>         Environment: Linux (Debian "Buster")
> OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
>            Reporter: Glenn Holmer
>            Priority: Blocker
>              Labels: deadlock
>         Attachments: 12.1-vc1-thread-dump-orac.txt, 
> nb12.1-beta1-thread-dump.png, nb12.1-beta1-thread-dump.txt, 
> netbeans-12.1-thread-dump.txt
>
>
>  
> NetBeans sometimes hangs on startup; the symptom is a stalled "Opening 
> Projects" progress bar. I haven't been able to find a repro case, but I'm 
> attaching a thread dump (from VisualVM) and screen shot.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to