--- a/csl.api/src/org/netbeans/modules/csl/core/TypeAndSymbolProvider.java +++ a/csl.api/src/org/netbeans/modules/csl/core/TypeAndSymbolProvider.java @@ -270,6 +270,8 @@ return new Object [] { QuerySupport.Kind.CASE_INSENSITIVE_REGEXP, NameMatcherFactory.wildcardsToRegexp(text,true) }; case CAMEL_CASE: return new Object [] { QuerySupport.Kind.CAMEL_CASE, text }; + case CASE_INSENSITIVE_CAMEL_CASE: + return new Object [] { QuerySupport.Kind.CASE_INSENSITIVE_CAMEL_CASE, text }; default: throw new IllegalStateException("Can't translate " + searchType + " to QuerySupport.Kind"); //NOI18N } --- a/java.sourceui/src/org/netbeans/modules/java/source/ui/FastTypeProvider.java +++ a/java.sourceui/src/org/netbeans/modules/java/source/ui/FastTypeProvider.java @@ -128,6 +128,7 @@ switch (context.getSearchType()) { case CASE_INSENSITIVE_EXACT_NAME: + case CASE_INSENSITIVE_CAMEL_CASE: sensitive = false; case CAMEL_CASE: pattern.append(createCamelCaseRegExp(context.getText(), sensitive)); --- a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaSymbolProvider.java +++ a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaSymbolProvider.java @@ -148,10 +148,13 @@ _caseSensitive = true; break; case CAMEL_CASE: - _ident = createCamelCase(_ident); _kind = ClassIndex.NameKind.CAMEL_CASE; _caseSensitive = true; break; + case CASE_INSENSITIVE_CAMEL_CASE: + _kind = ClassIndex.NameKind.CAMEL_CASE_INSENSITIVE; + _caseSensitive = false; + break; case EXACT_NAME: _kind = ClassIndex.NameKind.SIMPLE_NAME; _caseSensitive = true; @@ -373,18 +376,7 @@ } return e.getSimpleName().toString(); } - - private static String[] createCamelCase(final String[] text) { - if (text[0].length() == 0) { - return text; - } else { - return new String[] { - text[0], - Character.toLowerCase(text[0].charAt(0)) + text[0].substring(1) - }; - } - } - + private static CharSequence getTypeName(TypeMirror type, boolean fqn, boolean varArg) { if (type == null) return ""; //NOI18N --- a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeProvider.java +++ a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeProvider.java @@ -174,6 +174,7 @@ case REGEXP: nameKind = ClassIndex.NameKind.REGEXP; break; case CASE_INSENSITIVE_REGEXP: nameKind = ClassIndex.NameKind.CASE_INSENSITIVE_REGEXP; break; case CAMEL_CASE: nameKind = ClassIndex.NameKind.CAMEL_CASE; break; + case CASE_INSENSITIVE_CAMEL_CASE: nameKind = ClassIndex.NameKind.CAMEL_CASE_INSENSITIVE; break; default: throw new RuntimeException("Unexpected search type: " + searchType); } --- a/jumpto/nbproject/project.properties +++ a/jumpto/nbproject/project.properties @@ -47,7 +47,7 @@ javac.source=1.7 makenbm.override.license=LICENSE nbm.module.author=Andrei Badea, Petr Hrebejk -spec.version.base=1.42.0 +spec.version.base=1.43.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ --- a/jumpto/src/org/netbeans/modules/jumpto/common/Utils.java +++ a/jumpto/src/org/netbeans/modules/jumpto/common/Utils.java @@ -51,7 +51,11 @@ */ public class Utils { - private static Pattern camelCasePattern = Pattern.compile("(?:\\p{javaUpperCase}(?:\\p{javaLowerCase}|\\p{Digit}|\\.|\\$)*){2,}"); // NOI18N + private static Pattern camelCasePattern = Pattern.compile( + //Anything followowed by lowercase suffix - once + "(.(?:\\p{javaLowerCase}|\\p{Digit}|\\.|\\$)*)"+ //NOI18N + //Upcase followed by lowercase - at least once + "(?:\\p{javaUpperCase}(?:\\p{javaLowerCase}|\\p{Digit}|\\.|\\$)*){1,}"); // NOI18N private static final int MAX_INPUT_LENGTH = 1<<10; private static final char[] INVALID_CHARS = { '\n' //NOI18N --- a/jumpto/src/org/netbeans/modules/jumpto/file/FileSearchAction.java +++ a/jumpto/src/org/netbeans/modules/jumpto/file/FileSearchAction.java @@ -206,7 +206,7 @@ text = Utils.removeNonNeededWildCards(text); } else if ((Utils.isAllUpper(text) && text.length() > 1) || Utils.isCamelCase(text)) { - nameKind = QuerySupport.Kind.CAMEL_CASE; + nameKind = panel.isCaseSensitive() ? QuerySupport.Kind.CAMEL_CASE : QuerySupport.Kind.CASE_INSENSITIVE_CAMEL_CASE; } else { nameKind = panel.isCaseSensitive() ? QuerySupport.Kind.PREFIX : QuerySupport.Kind.CASE_INSENSITIVE_PREFIX; --- a/jumpto/src/org/netbeans/modules/jumpto/file/Worker.java +++ a/jumpto/src/org/netbeans/modules/jumpto/file/Worker.java @@ -437,8 +437,9 @@ static SearchType toJumpToSearchType(final QuerySupport.Kind searchType) { switch (searchType) { case CAMEL_CASE: + return org.netbeans.spi.jumpto.type.SearchType.CAMEL_CASE; case CASE_INSENSITIVE_CAMEL_CASE: - return org.netbeans.spi.jumpto.type.SearchType.CAMEL_CASE; + return org.netbeans.spi.jumpto.type.SearchType.CASE_INSENSITIVE_CAMEL_CASE; case CASE_INSENSITIVE_PREFIX: return org.netbeans.spi.jumpto.type.SearchType.CASE_INSENSITIVE_PREFIX; case CASE_INSENSITIVE_REGEXP: --- a/jumpto/src/org/netbeans/modules/jumpto/symbol/ContentProviderImpl.java +++ a/jumpto/src/org/netbeans/modules/jumpto/symbol/ContentProviderImpl.java @@ -543,7 +543,7 @@ //nameKind = isCaseSensitive ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME; return SearchType.EXACT_NAME; } else if ((Utils.isAllUpper(text) && text.length() > 1) || Utils.isCamelCase(text)) { - return SearchType.CAMEL_CASE; + return isCaseSensitive ? SearchType.CAMEL_CASE : SearchType.CASE_INSENSITIVE_CAMEL_CASE; } else if (wildcard != -1) { return isCaseSensitive ? SearchType.REGEXP : SearchType.CASE_INSENSITIVE_REGEXP; } else { --- a/jumpto/src/org/netbeans/modules/jumpto/type/GoToTypeAction.java +++ a/jumpto/src/org/netbeans/modules/jumpto/type/GoToTypeAction.java @@ -294,12 +294,10 @@ SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME); } else if ((Utils.isAllUpper(text) && text.length() > 1) || Utils.isCamelCase(text)) { - nameKinds = Arrays.asList( - new SearchType[] { - SearchType.CAMEL_CASE, - panel.isCaseSensitive() ? - SearchType.PREFIX : - SearchType.CASE_INSENSITIVE_PREFIX}); + nameKinds = Collections.singleton( + panel.isCaseSensitive() ? + SearchType.CAMEL_CASE : + SearchType.CASE_INSENSITIVE_CAMEL_CASE); } else if (wildcard != -1) { nameKinds = Collections.singleton( panel.isCaseSensitive() ? --- a/jumpto/src/org/netbeans/spi/jumpto/support/NameMatcherFactory.java +++ a/jumpto/src/org/netbeans/spi/jumpto/support/NameMatcherFactory.java @@ -121,7 +121,7 @@ private final Pattern pattern; - public CamelCaseNameMatcher(String name) { + public CamelCaseNameMatcher(String name, boolean caseSensitive) { if (name.length() == 0) { throw new IllegalArgumentException (); } @@ -136,7 +136,7 @@ patternString.append( index != -1 ? "[\\p{Lower}\\p{Digit}_]*" : ".*"); // NOI18N lastIndex = index; } while(index != -1); - pattern = Pattern.compile(patternString.toString()); + pattern = Pattern.compile(patternString.toString(), caseSensitive ? 0 : Pattern.CASE_INSENSITIVE); } private static int findNextUpper(String text, int offset ) { @@ -180,7 +180,9 @@ case CASE_INSENSITIVE_PREFIX: return new CaseInsensitivePrefixNameMatcher(text); case CAMEL_CASE: - return new CamelCaseNameMatcher(text); + return new CamelCaseNameMatcher(text, true); + case CASE_INSENSITIVE_CAMEL_CASE: + return new CamelCaseNameMatcher(text, false); default: throw new IllegalArgumentException("Unsupported type: " + type); //NOI18N } --- a/jumpto/src/org/netbeans/spi/jumpto/type/SearchType.java +++ a/jumpto/src/org/netbeans/spi/jumpto/type/SearchType.java @@ -81,6 +81,12 @@ */ CAMEL_CASE, + /** + * A search using a camel-case reduction of the type name + * while comparing the individual name parts case insensitively. + * @since 1.43 + */ + CASE_INSENSITIVE_CAMEL_CASE, /** * A search using a case-sensitive --- a/parsing.lucene/src/org/netbeans/modules/parsing/lucene/support/Queries.java +++ a/parsing.lucene/src/org/netbeans/modules/parsing/lucene/support/Queries.java @@ -43,16 +43,13 @@ package org.netbeans.modules.parsing.lucene.support; import java.io.IOException; -import java.util.BitSet; import java.util.regex.Pattern; import org.apache.lucene.document.FieldSelector; import org.apache.lucene.document.FieldSelectorResult; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermDocs; -import org.apache.lucene.index.TermEnum; import org.apache.lucene.search.BooleanClause; -import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.DocIdSet; import org.apache.lucene.search.Filter; @@ -215,14 +212,8 @@ if (value.length() == 0) { //Special case (all) handle in different way return f.createAllDocsQuery(caseInsensitiveFieldName); - } - else { - final Query pq = f.createPrefixQuery(caseInsensitiveFieldName, value.toLowerCase()); - final Query fq = f.createRegExpQuery(caseInsensitiveFieldName, createCamelCaseRegExp(value, false), false); - final BooleanQuery result = f.createBooleanQuery(); - result.add(pq, Occur.SHOULD); - result.add(fq, Occur.SHOULD); - return result; + } else { + return f.createRegExpQuery(caseInsensitiveFieldName, createCamelCaseRegExp(value, false), false); } default: throw new UnsupportedOperationException (kind.toString());