junichi11 edited a comment on pull request #2960:
URL: https://github.com/apache/netbeans/pull/2960#issuecomment-842273734


   URL is not highlighted.
   
   #### Before:
   
![netbeans-pr-2960-before](https://user-images.githubusercontent.com/738383/118484827-9df1c180-b752-11eb-925e-f80d8b7e30de.jpg)
   
   
   #### After:
   
![netbeans-pr-2960-after](https://user-images.githubusercontent.com/738383/118484837-a21ddf00-b752-11eb-97fa-0a28d077ed81.jpg)
   
   #### Exception:
   ```
   java.lang.UnsupportedOperationException: Not supported yet.
        at 
org.netbeans.modules.editor.url.HighlightURLs$3.subSequence(HighlightURLs.java:217)
        at java.util.regex.Matcher.getSubSequence(Matcher.java:1294)
        at java.util.regex.Matcher.group(Matcher.java:541)
        at 
org.netbeans.modules.editor.url.Parser.recognizeURLsREBased(Parser.java:44)
        at org.netbeans.modules.editor.url.Parser.recognizeURLs(Parser.java:36)
        at 
org.netbeans.modules.editor.url.HighlightURLs.run(HighlightURLs.java:222)
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
        at 
org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
        at 
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
   Caused: org.openide.util.RequestProcessor$FastItem: task failed due to
   ```
   
   Maybe `recognizeURLs()` is called many times, I suppose. Is the performance 
problem OK although I can be wrong?
   (about using `URL_PATTERN.matcher(text)` instead)
   
   *Update:*
   Actually, It seems that the handwritten parser is so fast.
   See:
   
https://github.com/apache/netbeans/blob/e87eb25de9e788832b8459165031b32936152a2e/ide/editor/test/unit/src/org/netbeans/modules/editor/url/ParserTest.java#L94-L119
   
   Test Result: times=2049 vs. 19441


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

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

Reply via email to