This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250445

Summary: UI freeze for 170 sec from JUnitTestCreatorProvider.enable
Product: java Reporter: Vladimir Voskresensky <vv159170>
Component: JUnitAssignee: Theofanis Oikonomou <theofanis>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P1    
Version: 8.1   
Hardware: PC   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description Vladimir Voskresensky 2015-02-16 12:24:44 UTC
I was under debug mode, so was able to attach to IDE to see why enable executes so long. Here is the investigation:

UnitTestCreatorProvider.enable
            if(fo.isFolder()) {
//                fos.addAll(Arrays.asList(fo.getChildren()));
                fos.addAll(Collections.list(fo.getChildren(true))); // <<<<
            } else {
                fos.add(fo);
            }
at // <<<< Here 45K files were added, because of 'true' parameter
as the result fast branch did't work
if (fos.size() == 1) {


My current FS layout is:
Project
  nbproject
  src
    .svn
       huge number of files

So, all src and .svn files were added recursively.
Btw, from history it's not clear where this code came from

        ArrayList<FileObject> fos = new ArrayList<FileObject>();
        for(FileObject fo : activatedFOs) {
            if(fo.isFolder()) {
//                fos.addAll(Arrays.asList(fo.getChildren()));
                fos.addAll(Collections.list(fo.getChildren(true)));
            } else {
                fos.add(fo);
            }
        }
it's annotated as 
http://hg.netbeans.org/cnd-main/diff/3d2503f2d0a3/junit/src/org/netbeans/modules/junit/JUnitTestCreatorProvider.java
so, strange to see getChidren as part of:
created gsf.testrunner.ui, removed openide.loaders and openide.modules from gsf.testrunner*, java.testrunner and gototest
(transplanted from 20bd7b6f1d5a7e7fb4e28330916acbe7815764d9)
Comment 1 Vladimir Voskresensky 2015-02-26 12:20:01 UTC
see the recent 230 sec on reopening IDE - it is 6 min in completely frozen state
http://statistics.netbeans.org/analytics/exception.do?id=767207
Comment 2 Vladimir Voskresensky 2015-02-26 12:20:41 UTC
Please, make action "enable" always true
Comment 3 Theofanis Oikonomou 2015-03-02 15:18:32 UTC
Changeset: 689a0fe6a467
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2015-03-02 16:17
Message:
Comment 4 Theofanis Oikonomou 2015-03-02 15:21:57 UTC
Problematic piece of code that was recursively querying source tree was removed. Basic checks are now only performed for the selected FileObjects, so it should work with no problem. Thank you for reporting.
Comment 5 Quality Engineering 2015-03-03 04:19:33 UTC
Integrated into 'main-silver', will be available in build *201503030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/689a0fe6a467
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #250445 - UI freeze for 170 sec from JUnitTestCreatorProvider.enable
Comment 6 Quality Engineering 2015-05-30 10:05:30 UTC
Integrated into 'main-silver', will be available in build *201505300811* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cfaf199057d2
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #250445 - UI freeze for 170 sec from JUnitTestCreatorProvider.enable
(transplanted from 689a0fe6a4670ed4181797ada40fc04913f48174)