This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 212412
Collapse All | Expand All

(-)a/java.editor/src/org/netbeans/modules/editor/java/Utilities.java (+30 lines)
Lines 166-171 Link Here
166
            return false;
166
            return false;
167
        if (prefix == null || prefix.length() == 0)
167
        if (prefix == null || prefix.length() == 0)
168
            return true;
168
            return true;
169
170
        // sub word completion
171
        {
172
            // example:
173
            // 'out' produces '.*?[o|O].*?[u|U].*?[t|T].*?'
174
            // org.openide.util.Utilities.acoh -> actionsForPath
175
            // java.lang.System.out -> setOut
176
            // argex -> IllegalArgumentException
177
            // java.util.Collections.que -> asLifoQueue
178
            
179
            // check whether user input matches the regex
180
            StringBuilder sb = new StringBuilder(3+8*prefix.length());
181
            sb.append(".*?");
182
            for (int i = 0; i < prefix.length(); i++) {
183
                char charAt = prefix.charAt(i);
184
                sb.append("[");
185
                sb.append(charAt);
186
                sb.append("|");
187
                sb.append(Character.toUpperCase(charAt));
188
                sb.append("]");
189
                sb.append(".*?");
190
            }
191
            
192
             System.out.println(sb);
193
            // FIXME regex matches are expensive
194
            if (Pattern.compile(sb.toString()).matcher(theString).matches()) {
195
                return true;
196
            };
197
        }
198
        
169
        return isCaseSensitive() ? theString.startsWith(prefix) :
199
        return isCaseSensitive() ? theString.startsWith(prefix) :
170
            theString.toLowerCase(Locale.ENGLISH).startsWith(prefix.toLowerCase(Locale.ENGLISH));
200
            theString.toLowerCase(Locale.ENGLISH).startsWith(prefix.toLowerCase(Locale.ENGLISH));
171
    }
201
    }

Return to bug 212412