sdedic commented on code in PR #4091:
URL: https://github.com/apache/netbeans/pull/4091#discussion_r905967489


##########
groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/GroovyIndex.java:
##########
@@ -348,6 +358,25 @@ public Set<IndexedMethod> getMethods(final String name, 
final String clz, QueryS
         return methods;
     }
 
+    private boolean matchInsensitiveCamelCase(String text, String where) {
+        if (text.length() > where.length()) {
+            return false;
+        }
+        String textP = text.toLowerCase();

Review Comment:
   Sorry :) I still believe this function is not a proper impl. At least two 
bugs here:
   `matchInsensitiveCamelCase("RgExPars", "RegExParser")` produces `true`, but 
`RgEx` should not match `R`e`gEx`. The culprit is IMHO this lowercase, as we 
loose information on the Capital-and-lowercase exact substrings to be searched.
   
   Try in IDE's Goto Type (type `RgExPars`)
   
   The 2nd bug is 
   ```
   if (whereP.length() <= (index + 1)) 
   ```
   That causes same string match (`matchInsensitiveCamelCase("RegExParser", 
"RegExParser")`)  to return `false` -- the last matching character satisfies 
the condition. Perhaps `break` should be here instead of `return`



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

Reply via email to