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 269890 - Find in editor sometimes doesn't find anything
Summary: Find in editor sometimes doesn't find anything
Alias: None
Product: editor
Classification: Unclassified
Component: Search (show other bugs)
Version: Dev
Hardware: PC Windows 7 x64
: P1 normal with 1 vote (vote)
Assignee: Milutin Kristofic
Depends on:
Reported: 2017-02-21 12:36 UTC by Pere
Modified: 2017-06-15 11:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Capture showing a string not found although the text exists in file (224.28 KB, image/png)
2017-02-21 12:36 UTC, Pere
The same tab after some irrelevant interaction - suddenly search works (238.09 KB, image/png)
2017-02-21 12:37 UTC, Pere
First occurrence of a searched string is found (178.11 KB, image/png)
2017-02-28 09:05 UTC, Pere
"Find:" field is unable to find the 2nd occurrence (180.98 KB, image/png)
2017-02-28 09:32 UTC, Pere
"Find" field is not finding the provided strings although they exist (224.40 KB, image/png)
2017-06-15 11:01 UTC, Pere

Note You need to log in before you can comment on or make changes to this bug.
Description Pere 2017-02-21 12:36:13 UTC
Created attachment 163678 [details]
Capture showing a string not found although the text exists in file

The "Find" field in the current editor sometimes fails miserably. This is as simple as pressing ctrl + f and putting an string you know for sure it exists. Of course I'm sure I'm not using quotes, wildcards or "strange" strings; also, "Match case" isn't selected, and "Wrap Around" is active to assure it will start search again once it has reached the end of the file. "Highlight matches" is also active to help make the faulty behaviour more evident.

This behaviour too often gets unnoticed / hidden, because the user can think that the text he/she searched for simply doesn't exist. But, very sadly, a number of times the cause is that the editor failed miserably, leading to faulty code, frustration and lack of productivity, making this IDE virtually unusable as it fails in such a basic task.

I'm attaching a couple of captures. In the 1st one I did a search; it didn't find any occurrence, but as I was totally sure the string existed in the file, I did a Right click over my project root source folder -> Find..., and guess what: it found it in the file I had just open in the editor. It's clearly seen in the capture. Also the searched string appears in red in the "Find:" field, as if it didn't exist in the open file.

The 2nd capture is exactly the same tab with the same searched string without further actions; I just did some basic interaction like switching a tab and going back, or minimizing and remaximizing Netbeans - can't remember what I did exactly, but was one of those things. Magically, without even attempting to find again (hadn't to press Enter nor the "<- Previous" or "-> Next" buttons or anything), when going back to this screen the search was there.
Comment 1 Pere 2017-02-21 12:37:57 UTC
Created attachment 163679 [details]
The same tab after some irrelevant interaction - suddenly search works
Comment 2 Pere 2017-02-28 08:48:58 UTC
I'm amazed by how popular my bug reports are and by the attention they capture from the development team.

I'm attaching a new couple of captures. In the 1st one (mainscreen1.png), the searched string is found, but after pressing enter in the "Find" textarea it says that there are no more occurrences (2nd capture; mainscreen2.png -- see bottom of the screen), although below is a "Find in projects" search result tab and it found the string twice in the file. 

In this example, the ocurrence at line 531 is, unexplainably, not found.

Very annoying.
Comment 3 Pere 2017-02-28 09:05:56 UTC
Created attachment 163727 [details]
First occurrence of a searched string is found

First occurrence in "Find:" textinput is found. You see there are TWO occurrences of this string in the tab below.
Comment 4 Pere 2017-02-28 09:32:48 UTC
Created attachment 163728 [details]
"Find:" field is unable to find the 2nd occurrence

There is a tab below where you can see that, in fact, there's a 2nd occurrence of the string being searched in the open file.
Comment 5 Milutin Kristofic 2017-03-08 09:57:22 UTC
Hi Pere,

thank you for your report. I understand this is annoying.

I would like to explain that in your second example you used feature that search for string only in highlighted area (blue one in your screenshot) and it found string there, but it doesn't look outside of that area. When you select a few lines in editor and press ctrl+f you are searching only in that area. You need to deselect this area and run ctrl+f again. This feature is there for 10 years at least.

In your first example there is probably bug, I need to investigate this more. I am afraid that search lost connection and focus for opened editor. Can you provide me messages.log if there are any logs for exceptions. I will add some later.

Since this bug is not reproducible and have vote just from you I am decreasing priority.
Comment 6 Pere 2017-03-10 12:11:11 UTC
Thanks a lot for your reply, Miluting. I've done a test and you are totally right; in my second example I was searching only in the highlighted area. I didn't know of that feature. D'oh.

Now that I know of it, I'll keep an eye into this to discard it has nothing to do with it. I don't see highlighted areas on my 1st example captures but I cannot assure it weren't the case.

Thanks again and sorry for any inconvenience.
Comment 7 Milutin Kristofic 2017-03-13 13:58:51 UTC
Hi Pere, thank you for understanding.
Comment 8 Milutin Kristofic 2017-04-03 14:02:36 UTC
This should be fixed with Bug #269726.

*** This bug has been marked as a duplicate of bug 269726 ***
Comment 9 Pere 2017-06-15 10:59:26 UTC
Well, it seems you fooled me into thinking I was doing things I wasn't doing.

I've been still experiencing this bug endlessly. Now running Dev 201705310001 and still experiencing the same. Every time it happens I triple check I am not searching in any "current selection", by clicking anywhere inside the editor, making a selection and then deselecting it, etc.

The capture I'm attaching happened just a couple of minutes ago. "Workaround" is as easy as minimizing Netbeans window and restoring it. I don't even need to explicitly press enter or click on "Previous" or "Next" inside the Find box; the occurrences that weren't found in the attached capture appear automatically highlighted in orange.

I see a lot of exceptions in messages.log but I find a bit difficult to provide it since it contains some "sensitive" information...
Comment 10 Pere 2017-06-15 11:01:00 UTC
Created attachment 164548 [details]
"Find" field is not finding the provided strings although they exist