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.
Use case: With the following code: FooBar fooBar; static final FooBar FOOBAR = ...; : fooBar.someMethod(); : and desire to modify the name of the Class and the variable it should be possible to do this in a single Find and Replace by using: find text: foobar replace text: mooBlah should result in a code: MooBlah mooBlah ; static final MooBlah MOOBLAH = ...; : mooBlah.someMethod(); : Notice how the case of the original Class name, variable and static final variable and the uppercase B in replacement text were used as hints to achieve the functionality. This is supported by emacs and is described like this in the emacs manuals: REF: http://www.gnu.org/software/emacs/manual/html_node/Replacement-and- Case.html#Replacement-and-Case " 20.9.3 Replace Commands and Case If the first argument of a replace command is all lower case, the command ignores case while searching for occurrences to replace—provided case-fold- search is non-nil. If case-fold-search is set to nil, case is always significant in all searches. In addition, when the newstring argument is all or partly lower case, replacement commands try to preserve the case pattern of each occurrence. Thus, the command M-x replace-string <RET> foo <RET> bar <RET> replaces a lower case ‘foo’ with a lower case ‘bar’, an all-caps ‘FOO’ with ‘BAR’, and a capitalized ‘Foo’ with ‘Bar’. (These three alternatives— lower case, all caps, and capitalized, are the only ones that replace-string can distinguish.) If upper-case letters are used in the replacement string, they remain upper case every time that text is inserted. If upper-case letters are used in the first argument, the second argument is always substituted exactly as given, with no case conversion. Likewise, if either case-replace or case-fold-search is set to nil, replacement is done without case conversion. "
Also see: http://www.netbeans.org/issues/show_bug.cgi?id=80798
*** Issue 80798 has been marked as a duplicate of this issue. ***
*** Issue 90387 has been marked as a duplicate of this issue. ***
*** Issue 117771 has been marked as a duplicate of this issue. ***
*** Issue 125144 has been marked as a duplicate of this issue. ***
Please see all the duplicates for different descriptions of the same usecase.
This definitely gets my vote. IntelliJ does this already. Very nice feature to have work manipulating large codebases.
*** Bug 199989 has been marked as a duplicate of this bug. ***
This gets my vote. Any chance of pushing this into version 7.1? On the face of it it sounds rather easy to implement.
I will implement this for to nb 7.1
I implemented preserve case to netbeans search and replace. http://hg.netbeans.org/jet-main/rev/5e39ff78b9d5 It has its own checkbox which is disabled if matchcase or regexp is selected. For example you search for foobar to replace by someElse FOOBAR -> SOMEELSE foobar -> someelse FooBar -> SomeElse fooBar -> someElse fOOBAR -> sOMEELSE Please notice upper case in someElse. Hope you like it.
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/5e39ff78b9d5 User: Milutin Kristofic <mkristofic@netbeans.org> Log: #80732 - Support Emacs style case sensitive find and replace - preserve case in ctrl+h search and replace dialog