JaroslavTulach commented on a change in pull request #3093: URL: https://github.com/apache/netbeans/pull/3093#discussion_r695721115
########## File path: ide/gsf.testrunner.ui/nbproject/project.xml ########## @@ -136,7 +145,7 @@ <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>9.0</specification-version> + <implementation-version/> Review comment: Turning normal dependency into implementation one. That's unfortunate. What's the reason? ########## File path: ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodFinder.java ########## @@ -0,0 +1,129 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.modules.gsf.testrunner.ui.api; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiConsumer; +import javax.swing.text.Position; +import org.netbeans.modules.gsf.testrunner.ui.TestMethodFinderImpl; +import org.netbeans.modules.parsing.impl.indexing.CacheFolder; +import org.netbeans.spi.project.SingleMethod; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.filesystems.URLMapper; +import org.openide.util.Exceptions; + +/** + * API to provide a list of {@link TestMethod}s found in sources under particular test roots. + * + * @author Dusan Balek + * @since 1.27 + */ +public final class TestMethodFinder { + + /** + * Provides a list of {@link TestMethod}s found in sources under particular test roots. + * + * @param testRoots roots to search test methods for + * @param listener a listener to inform about later changes + * @return map of test source files to tests methods found + * @since 1.27 + */ + public static Map<FileObject, Collection<TestMethodController.TestMethod>> findTestMethods(Iterable<FileObject> testRoots, BiConsumer<FileObject, Collection<TestMethodController.TestMethod>> listener) { + if (TestMethodFinderImpl.INSTANCE != null) { + TestMethodFinderImpl.INSTANCE.addListener(listener); Review comment: Adding a listener to singleton object. Doesn't this create a memory leak? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists