matthiasblaesing commented on pull request #3393: URL: https://github.com/apache/netbeans/pull/3393#issuecomment-1003186397
> > I had a look how `canBeMultilinePattern` is used and I think it would be easier and more consistent to modify the regexp `MULTILINE_REGEXP_PATTERN` in `TextRegexpUtil`. The util method is used to determine if a single line in the file is enough for examination or if the whole file needs to be matched. > > yeah I looked at that regexp too. Its just that the method actually expects a regexp (see doc and also the actual pattern) and checks if the regexp would want to match multiline. If it would also check if the regexps itself would be multiline that would make it a weird frankenstein method - so i decided against it. If you rename the method in your mind to `needsMultilineContext` it is in no way frankenstein, it does exactly what it should. A regexp containing a "real" newline character will also fail, so why not fix it there? Without fixing it in this one method, you need to also fix `FastMatcher`. > [Tests] The tests are not exhaustive, the cases: `test\ntest` `test\rtest` `test\r\ntest` are missing. You demonstrated, that they can be entered by copying and adding them causes test failures. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
