ratcashdev commented on code in PR #3995:
URL: https://github.com/apache/netbeans/pull/3995#discussion_r961141304


##########
java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitNodeOpener.java:
##########
@@ -114,11 +114,16 @@ public void run(CompilationController 
compilationController) throws Exception {
                             
compilationController.toPhase(Phase.ELEMENTS_RESOLVED);
                             Trees trees = compilationController.getTrees();
                             CompilationUnitTree compilationUnitTree = 
compilationController.getCompilationUnit();
+                            String desiredClassName = 
extractDeepestClass(node.getTestcase().getClassName());
                             List<? extends Tree> typeDecls = 
compilationUnitTree.getTypeDecls();
                             for (Tree tree : typeDecls) {
                                 Element element = 
trees.getElement(trees.getPath(compilationUnitTree, tree));
-                                if (element != null && element.getKind() == 
ElementKind.CLASS && 
element.getSimpleName().contentEquals(fo2open[0].getName())) {
-                                    List<? extends ExecutableElement> 
methodElements = ElementFilter.methodsIn(element.getEnclosedElements());
+                                Element classElement = 
getClassElement(element, desiredClassName);

Review Comment:
   Fix pushed. I guess the challenge of navigating to a specific class/method 
is quite common and should be solved once. Right now, a code like this is 
written at least 3 times (Gradle, TestNg, Maven/JUnit) so it would be great to 
have it unified, but I think it would be best to leave such a change it to a 
pure 'refactoring PR'



-- 
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

Reply via email to