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.
The camel case completion is very useful. But frequently, tremendous candidate appears and there is no way to narrow them. So, I tried to customize NetBeans to narrow candidates of camel case completion by inputing lower character. It is very nice. The source modified is shown bellow. /java/editor/src/org/netbeans/modules/editor/java/JMIUtils.java 819: java.util.regex.Pattern pat = java.util.regex.Pattern.compile("([A-Z]+)([^A-Z]*) "); java.util.regex.Matcher mat = pat.matcher(name); boolean camelCase = mat.matches(); String up = ""; String lo = ""; if(camelCase){ up = mat.group(1); lo = mat.group(2); } 846: if (!startsWith(featureName, name) && (!camelCase || !(feature instanceof JavaClass) || !matchesCamelCaseEx(featureName, up, lo))) continue; 1171: public static boolean matchesCamelCaseEx(String simpleName, String up, String lo) { int sni; int pi; for (pi = 0, sni = 0; sni < simpleName.length() && pi < up.length(); sni++) { char ch = simpleName.charAt(sni); if (Character.isUpperCase(ch)) { if (ch != up.charAt(pi++)) { return false; } } } if(pi != up.length()) return false; if(lo.length() > 0){ if(!simpleName.substring(sni).startsWith(lo)){ return false; } } return true; } /java/editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java 159: java.util.regex.Pattern pat = java.util.regex.Pattern.compile("([A-Z]+)([^A-Z]*) "); java.util.regex.Matcher mat = pat.matcher(prefix); boolean camelCase = mat.matches(); String up = ""; String lo = ""; if(camelCase){ up = mat.group(1); lo = mat.group(2); } 163: || (camelCase && (itm instanceof NbJMIResultItem.ClassResultItem) && JMIUtils. matchesCamelCaseEx(itm.getItemText(), up, lo)))
Created attachment 28281 [details] working image
Camel case completion is almost useless without this kind of enhancement. E.g., "IA" matches about a gazillion classes, whereas "InAdm" only matches "InvoiceAdmin".