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


##########
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:
   ```diff
   diff --git 
a/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java 
b/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java
   index 080fa9c..c8e4378 100644
   --- a/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java
   +++ b/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java
   @@ -50,7 +50,7 @@
     * @author mkleint
     */
    public final class OutputUtils {
   -    public static final Pattern linePattern = 
Pattern.compile("(?:\\[catch\\])?\\sat (.*)\\((?:Native 
Method|(.*)\\.java\\:(\\d+))\\)"); //NOI18N
   +    public static final Pattern linePattern = 
Pattern.compile("(?:\\[\\w+\\]\\s+)?(?:\\[catch\\])?\\sat (.*)\\((?:Native 
Method|(.*)\\.java\\:(\\d+))\\)"); //NOI18N
     
        private static final Map<Project, StacktraceOutputListener> 
projectStacktraceListeners = new WeakHashMap<>();
        private static final Map<FileObject, StacktraceOutputListener> 
fileStacktraceListeners = new WeakHashMap<>();
   @@ -123,7 +123,7 @@
         */
        private static StacktraceAttributes matchStackTraceLine(String line) {
            Matcher match = linePattern.matcher(line);
   -        if (match.find() && match.groupCount() == 3) {
   +        if (match.matches() && match.groupCount() == 3) {
                String method = match.group(1);
                String file = match.group(2);
                String lineNum = match.group(3);
   
   ```
   this would work.



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