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.

Bug 90387 - Search and replace should be more intelligent in honoring case
Summary: Search and replace should be more intelligent in honoring case
Status: RESOLVED DUPLICATE of bug 80732
Alias: None
Product: editor
Classification: Unclassified
Component: Search (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Roskanin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-30 19:53 UTC by Scott Violet
Modified: 2008-01-23 09:57 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Violet 2006-11-30 19:53:10 UTC
Currently search and replace honors the case typed into the search dialog. For
example, if I have the text:

    public void setCharProperty(char value) {
        char oldValue = this.charProperty;
        this.charProperty = value;
        support.firePropertyChange("charProperty", oldValue, value);
    }

with a search text of char and a replace text of string, I end up with:

    public void setstringProperty(string value) {
        string oldValue = this.stringProperty;
        this.stringProperty = value;
        support.firePropertyChange("stringProperty", oldValue, value);
    }

Which isn't really what I wanted. Instead I want the replaced text to end up in
the same case as that of the text being replaced:

    public void setStringProperty(String value) {
        String oldValue = this.stringProperty;
        this.stringProperty = value;
        support.firePropertyChange("stringProperty", oldValue, value);
    }

This makes it so much easier to search and replace text as you don't have to
worry about the case. Emacs has been doing this for years.
Comment 1 Vitezslav Stejskal 2008-01-23 09:53:59 UTC
> Which isn't really what I wanted. Instead I want the replaced text to end up in
> the same case as that of the text being replaced:

Strictly speaking, following your rule, the text after replacing would look like this:

    public void setStringProperty(string value) {
        string oldValue = this.stringProperty;
        this.stringProperty = value;
        support.firePropertyChange("stringProperty", oldValue, value);
    }

It would be better than nothing, but the 'string' as a type of the method parameter and oldValue would still cause a
compilation error. Anyway, I think I got your point and I agree that this should be improved. Thanks
Comment 2 Vitezslav Stejskal 2008-01-23 09:57:43 UTC

*** This issue has been marked as a duplicate of 80732 ***