Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 134555 | Differences between
and this patch

Collapse All | Expand All

(-)java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/CountingSecurityManager.java (+117 lines)
Added Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.java.j2seproject;
41
42
import java.io.FileDescriptor;
43
import java.io.PrintWriter;
44
import java.io.StringWriter;
45
import java.security.Permission;
46
import junit.framework.Assert;
47
48
/**
49
 *
50
 * @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
51
 */
52
final class CountingSecurityManager extends SecurityManager {
53
    private static int cnt;
54
    private static StringWriter msgs;
55
    private static PrintWriter pw;
56
    private static String prefix;
57
    
58
    public static void initialize(String prefix) {
59
        if (System.getSecurityManager() instanceof CountingSecurityManager) {
60
            // ok
61
        } else {
62
            System.setSecurityManager(new CountingSecurityManager());
63
        }
64
        cnt = 0;
65
        msgs = new StringWriter();
66
        pw = new PrintWriter(msgs);
67
        CountingSecurityManager.prefix = prefix;
68
    }
69
    
70
    public static void assertCounts(String msg, int expectedCnt) {
71
        if (expectedCnt < cnt) {
72
            Assert.fail(msg + "\n" + msgs + " expected: " + expectedCnt + " real: " + cnt);
73
        }
74
        cnt = 0;
75
        msgs = new StringWriter();
76
        pw = new PrintWriter(msgs);
77
    }
78
79
    @Override
80
    public void checkRead(String file) {
81
        if (file.startsWith(prefix)) {
82
            cnt++;
83
            pw.println("checkRead: " + file);
84
    //        new Exception().printStackTrace(pw);
85
        }
86
    }
87
88
    @Override
89
    public void checkRead(String file, Object context) {
90
        if (file.startsWith(prefix)) {
91
            cnt++;
92
            pw.println("checkRead2: " + file);
93
        }
94
    }
95
96
    @Override
97
    public void checkWrite(FileDescriptor fd) {
98
        cnt++;
99
        pw.println("Fd: " + fd);
100
    }
101
102
    @Override
103
    public void checkWrite(String file) {
104
        if (file.startsWith(prefix)) {
105
            cnt++;
106
            pw.println("checkWrite: " + file);
107
        }
108
    }
109
110
    @Override
111
    public void checkPermission(Permission perm) {
112
    }
113
114
    @Override
115
    public void checkPermission(Permission perm, Object context) {
116
    }
117
}
(-)java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/PackageViewTest.java (+131 lines)
Added Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * Contributor(s):
25
 *
26
 * The Original Software is NetBeans. The Initial Developer of the Original
27
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
28
 * Microsystems, Inc. All Rights Reserved.
29
 *
30
 * If you wish your version of this file to be governed by only the CDDL
31
 * or only the GPL Version 2, indicate your decision by adding
32
 * "[Contributor] elects to include this software in this distribution
33
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
34
 * single choice of license, a recipient has the option to distribute
35
 * your version of this file under either the CDDL, the GPL Version 2 or
36
 * to extend the choice of license to its licensees as provided above.
37
 * However, if you add GPL Version 2 code and therefore, elected the GPL
38
 * Version 2 license, then the option applies only if the new code is
39
 * made subject to such option by the copyright holder.
40
 */
41
42
package org.netbeans.modules.java.j2seproject;
43
44
import java.io.File;
45
import org.netbeans.api.project.FileOwnerQuery;
46
import org.netbeans.api.project.Project;
47
import org.netbeans.junit.MockServices;
48
import org.netbeans.junit.NbTestCase;
49
import org.netbeans.modules.java.j2seproject.ui.SourceNodeFactory;
50
import org.netbeans.spi.project.support.ant.AntProjectHelper;
51
import org.netbeans.spi.project.ui.LogicalViewProvider;
52
import org.netbeans.spi.project.ui.support.NodeList;
53
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileUtil;
55
import org.openide.modules.SpecificationVersion;
56
import org.openide.nodes.Node;
57
58
/**
59
 * Generates project, tries to open a package and counts number of accesses
60
 * to it.
61
 *
62
 * @author Jaroslav Tulach
63
 */
64
public class PackageViewTest extends NbTestCase {
65
    
66
    public PackageViewTest(String testName) {
67
        super(testName);
68
    }
69
70
    private static final String[] createFiles = {
71
        "build.xml",
72
        "nbproject/build-impl.xml",
73
        "nbproject/project.xml",
74
        "nbproject/project.properties",
75
        "src/",
76
        "src/net/sf/dvbcentral/Test.java",
77
        "src/net/sf/dvbcentral/Test1.java",
78
        "src/net/sf/dvbcentral/Test2.java",
79
        "src/net/sf/dvbcentral/Test3.java",
80
        "src/net/sf/dvbcentral/Test4.java",
81
        "test/",
82
    };
83
    
84
85
    public void testCreateProject() throws Exception {
86
        File proj = getWorkDir();
87
        clearWorkDir();
88
        J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.4"));   //NOI18N
89
        AntProjectHelper aph = J2SEProjectGenerator.createProject(proj, "test-project", null, "manifest.mf", null);
90
        J2SEProjectGenerator.setDefaultSourceLevel(null);
91
        assertNotNull(aph);
92
        FileObject fo = aph.getProjectDirectory();
93
        for (int i=0; i < createFiles.length; i++) {
94
            if (createFiles[i].endsWith("/")) {
95
                FileUtil.createFolder(fo, createFiles[i]);
96
            } else {
97
                FileUtil.createData(fo, createFiles[i]);
98
            }
99
            assertNotNull(createFiles[i]+" file/folder cannot be found", fo.getFileObject(createFiles[i]));
100
        }
101
102
        Project prj = FileOwnerQuery.getOwner(fo);
103
        
104
        
105
        CountingSecurityManager.initialize(FileUtil.toFile(fo).getAbsolutePath());
106
107
        SourceNodeFactory factory = new SourceNodeFactory();
108
        NodeList arr = factory.createNodes(prj);
109
        assertNotNull("Not null root node created", arr);
110
        assertEquals("Arr is now 2", 2, arr.keys().size());
111
        
112
        Node src = arr.node(arr.keys().get(0));
113
        Node pkg = assertNode(src, "net.sf.dvbcentral");
114
        assertNotNull("Package found");
115
        
116
        CountingSecurityManager.assertCounts("Just few checks", 1);
117
    } 
118
119
    
120
    private static Node assertNode(Node where, String what) {
121
        StringBuffer sb = new StringBuffer();
122
        for (Node n : where.getChildren().getNodes(true)) {
123
            if (n.getName().equals(what)) {
124
                return n;
125
            }
126
            sb.append("  n: " + n.getName() + "\n");
127
        }
128
        fail("Cannot find node " + what + " only " + where.getChildren().getNodesCount() + " is available:\n" + sb);
129
        return null;
130
    }
131
}
(-)java.project/src/org/netbeans/spi/java/project/support/ui/PackageView.java (+10 lines)
 Lines 72-77   import org.openide.nodes.AbstractNode; Link Here 
72
import org.openide.nodes.AbstractNode;
72
import org.openide.nodes.AbstractNode;
73
import org.openide.nodes.FilterNode;
73
import org.openide.nodes.FilterNode;
74
import org.openide.nodes.Node;
74
import org.openide.nodes.Node;
75
import org.openide.util.Lookup;
75
import org.openide.util.NbBundle;
76
import org.openide.util.NbBundle;
76
import org.openide.util.WeakListeners;
77
import org.openide.util.WeakListeners;
77
78
 Lines 152-157   public class PackageView { Link Here 
152
     * @param showProgress whether to show a progress handle or not
153
     * @param showProgress whether to show a progress handle or not
153
     */
154
     */
154
    static void findNonExcludedPackages(PackageViewChildren children, Collection<PackageItem> target, FileObject fo, SourceGroup group, boolean showProgress) {
155
    static void findNonExcludedPackages(PackageViewChildren children, Collection<PackageItem> target, FileObject fo, SourceGroup group, boolean showProgress) {
156
        PackagesProvider.Request request = new PackagesProvider.Request(fo, group);
157
        PackagesProvider.Response response = new PackagesProvider.Response(children, target);
158
        for (PackagesProvider p : Lookup.getDefault().lookupAll(PackagesProvider.class)) {
159
            p.compute(request, response);
160
            if (response.done) {
161
                return;
162
            }
163
        }
164
        
155
        if (showProgress) {
165
        if (showProgress) {
156
            ProgressHandle progress = ProgressHandleFactory.createHandle(NbBundle.getMessage(PackageView.class, "PackageView.find_packages_progress", FileUtil.getFileDisplayName(fo)));
166
            ProgressHandle progress = ProgressHandleFactory.createHandle(NbBundle.getMessage(PackageView.class, "PackageView.find_packages_progress", FileUtil.getFileDisplayName(fo)));
157
            progress.start(1000);
167
            progress.start(1000);
(-)java.project/src/org/netbeans/spi/java/project/support/ui/PackagesProvider.java (+96 lines)
Added Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.spi.java.project.support.ui;
41
42
import java.util.Collection;
43
import org.netbeans.api.project.SourceGroup;
44
import org.netbeans.spi.java.project.support.ui.PackageView.PackageItem;
45
import org.openide.filesystems.FileObject;
46
47
/** An interface that can be registered into {@link org.openide.util.Lookup.getDefault()}
48
 * to provide pre-cached results for list of packages for given folder and source group.
49
 *
50
 * @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
51
 */
52
public interface PackagesProvider {
53
    public void compute(Request request, Response response);
54
    
55
    public static final class Request {
56
        final FileObject fo;
57
        final SourceGroup sourceGroup;
58
59
        Request(FileObject fo, SourceGroup sourceGroup) {
60
            this.fo = fo;
61
            this.sourceGroup = sourceGroup;
62
        }
63
64
        public FileObject getFolder() {
65
            return fo;
66
        }
67
68
        public SourceGroup getSourceGroup() {
69
            return sourceGroup;
70
        }
71
    }
72
    
73
    public static final class Response {
74
        private final Collection<PackageView.PackageItem> res;
75
        private final PackageViewChildren children;
76
        boolean done;
77
78
        Response(PackageViewChildren children, Collection<PackageItem> res) {
79
            this.res = res;
80
            this.children = children;
81
        }
82
        
83
        public void addPackage(SourceGroup group, FileObject packageFolder, boolean empty) {
84
            if (res != null) {
85
                res.add(new PackageItem(group, packageFolder, empty));
86
            } else {
87
                children.add(packageFolder, empty, false);
88
            }
89
            done = true;
90
        }
91
        
92
        public void finish() {
93
            done = true;
94
        }
95
    }
96
}
(-)java.project/test/unit/src/org/netbeans/spi/java/project/support/ui/CountingSecurityManager.java (+117 lines)
Added Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.spi.java.project.support.ui;
41
42
import java.io.FileDescriptor;
43
import java.io.PrintWriter;
44
import java.io.StringWriter;
45
import java.security.Permission;
46
import junit.framework.Assert;
47
48
/**
49
 *
50
 * @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
51
 */
52
final class CountingSecurityManager extends SecurityManager {
53
    private static int cnt;
54
    private static StringWriter msgs;
55
    private static PrintWriter pw;
56
    private static String prefix;
57
    
58
    public static void initialize(String prefix) {
59
        if (System.getSecurityManager() instanceof CountingSecurityManager) {
60
            // ok
61
        } else {
62
            System.setSecurityManager(new CountingSecurityManager());
63
        }
64
        cnt = 0;
65
        msgs = new StringWriter();
66
        pw = new PrintWriter(msgs);
67
        CountingSecurityManager.prefix = prefix;
68
    }
69
    
70
    public static void assertCounts(String msg, int expectedCnt) {
71
        if (expectedCnt < cnt) {
72
            Assert.fail(msg + "\n" + msgs + " expected: " + expectedCnt + " real: " + cnt);
73
        }
74
        cnt = 0;
75
        msgs = new StringWriter();
76
        pw = new PrintWriter(msgs);
77
    }
78
79
    @Override
80
    public void checkRead(String file) {
81
        if (file.startsWith(prefix)) {
82
            cnt++;
83
            pw.println("checkRead: " + file);
84
    //        new Exception().printStackTrace(pw);
85
        }
86
    }
87
88
    @Override
89
    public void checkRead(String file, Object context) {
90
        if (file.startsWith(prefix)) {
91
            cnt++;
92
            pw.println("checkRead2: " + file);
93
        }
94
    }
95
96
    @Override
97
    public void checkWrite(FileDescriptor fd) {
98
        cnt++;
99
        pw.println("Fd: " + fd);
100
    }
101
102
    @Override
103
    public void checkWrite(String file) {
104
        if (file.startsWith(prefix)) {
105
            cnt++;
106
            pw.println("checkWrite: " + file);
107
        }
108
    }
109
110
    @Override
111
    public void checkPermission(Permission perm) {
112
    }
113
114
    @Override
115
    public void checkPermission(Permission perm, Object context) {
116
    }
117
}
(-)java.project/test/unit/src/org/netbeans/spi/java/project/support/ui/PackageViewTest.java (-1 / +56 lines)
 Lines 60-69   import javax.swing.Icon; Link Here 
60
import javax.swing.Icon;
60
import javax.swing.Icon;
61
import javax.swing.SwingUtilities;
61
import javax.swing.SwingUtilities;
62
import javax.swing.event.ChangeListener;
62
import javax.swing.event.ChangeListener;
63
import junit.framework.Test;
63
import org.netbeans.api.project.SourceGroup;
64
import org.netbeans.api.project.SourceGroup;
64
import org.netbeans.api.project.TestUtil;
65
import org.netbeans.api.project.TestUtil;
65
import org.netbeans.api.queries.VisibilityQuery;
66
import org.netbeans.api.queries.VisibilityQuery;
66
import org.netbeans.junit.NbTestCase;
67
import org.netbeans.junit.NbTestCase;
68
import org.netbeans.junit.NbTestSuite;
67
import org.netbeans.spi.queries.VisibilityQueryImplementation;
69
import org.netbeans.spi.queries.VisibilityQueryImplementation;
68
import org.openide.filesystems.FileLock;
70
import org.openide.filesystems.FileLock;
69
import org.openide.filesystems.FileObject;
71
import org.openide.filesystems.FileObject;
 Lines 85-90   public class PackageViewTest extends NbT Link Here 
85
        super( name );
87
        super( name );
86
    }
88
    }
87
    
89
    
90
    public static Test suite() {
91
        //return new NbTestSuite(PackageViewTest.class);
92
        return new PackageViewTest("testDiskAccessFolders");
93
    }
94
    
88
    private FileObject root;
95
    private FileObject root;
89
    
96
    
90
    protected void setUp() throws Exception {
97
    protected void setUp() throws Exception {
 Lines 94-100   public class PackageViewTest extends NbT Link Here 
94
        // Get "Wrong # or names of nodes expected:<[c.d, c.f, p.me.toolsx]> but was:<[c.d, c.f, p.me.tools, p.me.toolsx]>"
101
        // Get "Wrong # or names of nodes expected:<[c.d, c.f, p.me.toolsx]> but was:<[c.d, c.f, p.me.tools, p.me.toolsx]>"
95
        // from testRename after call to n.setName("p.me.toolsx")
102
        // from testRename after call to n.setName("p.me.toolsx")
96
        // This however seems to work all the time:
103
        // This however seems to work all the time:
97
        TestUtil.setLookup( Lookups.fixed( new Object[] { new VQImpl(), PackageViewTest.class.getClassLoader() } ) ); 
104
        TestUtil.setLookup( Lookups.fixed( new Object[] { 
105
            new VQImpl(), PackageViewTest.class.getClassLoader(),
106
            new MyFolderProvider()
107
        } ) ); 
98
        root = TestUtil.makeScratchDir(this);
108
        root = TestUtil.makeScratchDir(this);
99
    }
109
    }
100
    
110
    
 Lines 966-971   public class PackageViewTest extends NbT Link Here 
966
        
976
        
967
    }
977
    }
968
    
978
    
979
    public void testDiskAccessFolders() throws Exception {
980
        assertNull( "source folder should not exist yet", root.getFileObject( "src" ) );
981
        
982
        FileObject src = FileUtil.createFolder(root, "src");
983
	// Create children
984
        SourceGroup group = new SimpleSourceGroup(src);
985
        
986
        Set<String> folders = new HashSet<String>();
987
        for (int i = 0; i < 10000; i++) {
988
            String folder = "" + (i / 1000) + "/" + ((i / 100) % 10);
989
            
990
            FileObject fo = FileUtil.createData(
991
                src, 
992
                folder + "/File" + (i % 10) + ".java"
993
            );
994
            folders.add(folder);
995
        }
996
        MyFolderProvider.folders = folders;
997
        
998
        CountingSecurityManager.initialize(getWorkDirPath());
999
        Children ch = PackageView.createPackageView( group ).getChildren();
1000
        Node[] compute = ch.getNodes(true);
1001
        assertEquals("packages is 100", 100, compute.length);
1002
        CountingSecurityManager.assertCounts("almost no touches", 250);
1003
    }    
1004
    
1005
    public static final class MyFolderProvider implements PackagesProvider {
1006
        static Set<String> folders;
1007
1008
        public void compute(Request request, Response response) {
1009
            if (folders == null) {
1010
                return;
1011
            }
1012
            for (String s : folders) {
1013
                response.addPackage(
1014
                    request.getSourceGroup(), 
1015
                    request.getFolder().getFileObject(s), 
1016
                    false
1017
                );
1018
            }
1019
            folders = null;
1020
        }
1021
    }
1022
    
1023
    
969
    private static class VQImpl implements VisibilityQueryImplementation {
1024
    private static class VQImpl implements VisibilityQueryImplementation {
970
        
1025
        
971
        public static String IGNORED = "KRTEK"; 
1026
        public static String IGNORED = "KRTEK"; 

Return to bug 134555
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo