You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/12/15 15:27:17 UTC

[GitHub] [netbeans] jglick commented on a diff in pull request #5099: fix output window stacktrace parsing when mvnd is used.

jglick commented on code in PR #5099:
URL: https://github.com/apache/netbeans/pull/5099#discussion_r1049778395


##########
java/maven/src/org/netbeans/modules/maven/execute/CommandLineOutputHandler.java:
##########
@@ -319,15 +321,20 @@ private String readLine() throws IOException {
                     }
                     Matcher lineMatcher = linePattern.matcher(line);
                     if (lineMatcher.matches()) {
-                        Level level = Level.valueOf(lineMatcher.group(1));
-                        String text = lineMatcher.group(2);
-                        updateFoldForException(text);
-                        processLine(MavenSettings.getDefault().isShowLoggingLevel() ? line : text, stdOut, level);
+                        String level_group = lineMatcher.group(1);
+                        Level level = mapLevel(lineMatcher.group(2));
+                        String msg = lineMatcher.group(3);

Review Comment:
   What are groups 1, 2, and 3 here? I only see two captured groups in https://github.com/apache/netbeans/blob/2968ee08a5347b727813a8ee4b4215043344c289/java/maven/src/org/netbeans/modules/maven/execute/CommandLineOutputHandler.java#L83 unless I am missing something.



##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -123,7 +123,7 @@ public static OutputListener matchStackTraceLine(String line, FileObject fileObj
      */
     private static StacktraceAttributes matchStackTraceLine(String line) {
         Matcher match = linePattern.matcher(line);
-        if (match.matches() && match.groupCount() == 3) {
+        if (match.find() && match.groupCount() == 3) {

Review Comment:
   Why this change? `matches` looks more correct to me since we are not interested in lines like
   
   ```
   Some other output! including [WARNING] for some other reason
   ```



-- 
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-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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