Bug 149927

Summary: Incremental find does not work in Eclipse
Product: [Fedora] Fedora Reporter: Ziga Mahkovec <ziga.mahkovec>
Component: eclipseAssignee: Andrew Overholt <overholt>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: pmuldoon, tsui.tony
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-30 15:05:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Workaround for the lack of quoting regex constructs
none
Workaround for the lack of quoting regex constructs none

Description Ziga Mahkovec 2005-02-28 20:49:52 UTC
Description of problem:
Incremental find does not work when editing files in Eclipse.

Version-Release number of selected component (if applicable):
eclipse-platform-3.1.0_fc-0.M5.6
libgcj4-4.0.0-0.27

How reproducible:
Always

Steps to Reproduce:
1.  Open a file in the editor.
2.  Select Edit/Incremental Find Next (or press Ctrl-J).
3.  Type the text to search for.
  
Actual results:
Nothing happens.

Expected results:
The mode and search string should be shown in the status bar.  Also, the text
should be incrementally searched for.

Additional info:

It the gnu.gcj.precompiled.db.path argument is removed from /usr/bin/eclipse,
the status bar does update, but Eclipse is still failing to find any text.
When using java-1.5.0-sun, it works fine.

Comment 1 Ziga Mahkovec 2005-03-05 20:58:03 UTC
There seems to be a problem with text search in general.  E.g. if I bring up the
Find/Replace dialog (Ctrl-F) and try to search for a simple string (e.g.
"class"), no results are found (incorrectly).  Then I turn on the "Regular
expressions" option and it works fine.

This was with eclipse-platform-3.1.0_fc-0.M5.8.


Comment 2 Ziga Mahkovec 2005-03-07 12:58:20 UTC
After further investigation, this looks like a problem with GNU Classpath's
regex implementation.  Eclipse makes use of the quoting regular expression
constructs (\Q and \E), which aren't implemented in gnu.regexp.RE.  A simple test:

    Pattern.compile("\\Q" + "boo" + "\\E").matcher("Peekaboo").find()

returns false using gcj and true using java-sun.

I'll file this in classpath's bugzilla; I'm also attaching a patch for
eclipse-3.1M5a which works around the problem.


Comment 3 Ziga Mahkovec 2005-03-07 13:00:04 UTC
Created attachment 111736 [details]
Workaround for the lack of quoting regex constructs

Comment 4 Andrew Overholt 2005-03-08 17:48:53 UTC
I'm trying this patch out now and if things go well, I'll rebuild with it!

Thanks!

Andrew

Comment 5 Andrew Overholt 2005-03-08 17:52:07 UTC
*** Bug 150514 has been marked as a duplicate of this bug. ***

Comment 6 Andrew Overholt 2005-03-09 16:12:27 UTC
Applying the patch lets things like Ctrl-F work but doesn't fix the
larger problem of the main search functionality not working.  I've put
the patch into a build that I'm doing now so hopefully that'll make test1.

Thanks again, Ziga.

Comment 7 Ziga Mahkovec 2005-03-09 22:21:21 UTC
What are the other symptoms of search functionality not working?

I did find a couple of other cases where the said regex constructs
were used, but they seemed harmless (e.g.
RegExContentAssistProcessor.java).  Of course, there are other
shortcomings of there current java.util.regex implementation.  I'm
currently writing a Mauve test that should underline those.

Comment 8 Andrew Overholt 2005-03-10 14:35:09 UTC
The main search function (the flashlight icon) when using the Files
tab (the left-most one) always seems to have the Search button
greyed-out.  (I'm not in front of a computer with Eclipse right now so
my from-memory bug comment may seem silly.  sorry ;)

Comment 9 Ziga Mahkovec 2005-03-13 21:26:12 UTC
The disabled Search button was a native-only issue (could be worked around by
removing the gnu.gcj.precompiled.db.path argument).  However, this seems to be
fixed with the latest libgcj update (4.0.0-0.33) -- the Search button is now
enabled in both modes.

But even so, searching files only worked when regular expressions were enabled.
 This is again due to the use of quoting regex constructs (this time in
PatternConstructor).  I updated my previous patch; hopefully, this will fix all
search related problems.

Note that once the classpath bug[1] is resolved, this patch becomes obsolete.

[1] https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=12307

Comment 10 Ziga Mahkovec 2005-03-13 21:28:00 UTC
Created attachment 111954 [details]
Workaround for the lack of quoting regex constructs

Comment 11 Andrew Overholt 2005-03-16 21:53:56 UTC
I've opened a new libgcj bug which is the same as your classpath bug, Ziga:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20504

I'm also trying a build right now with your updated patch.  I'll post back here
when it's done.

Thanks again for all your hard work, Ziga!

Comment 12 Andrew Overholt 2005-05-09 18:05:26 UTC
Things seem to work for me with gcc* >= 4.0.0-4 (not yet in rawhide IIRC). 
General search still seems screwy.

Still no news from the FSF, Ziga?

Comment 13 Ziga Mahkovec 2005-05-09 20:56:32 UTC
> Things seem to work for me with gcc* >= 4.0.0-4 (not yet in rawhide IIRC). 
> General search still seems screwy.

I couldn't test this with the latest version due to bug #157255 but last I
checked, searching worked fine with the patches (both incremental/editor search
and search in files).  Are you seeing the disabled button issue again?

> Still no news from the FSF, Ziga?

Unfortunately not.



Comment 14 Ziga Mahkovec 2005-05-09 21:02:20 UTC
Changing state back to NEEDINFO (Bugzilla changed it automatically)

Comment 15 Ziga Mahkovec 2005-05-16 23:57:08 UTC
I tried searching with eclipse-jdt-3.1.0_fc-0.M6.16 and libgcj-4.0.0-5.

I can confirm that there are problems with File Search again.  However, this
doesn't seem related to the regex issue we had before.  I couldn't get file
search to work properly even when using a patched gcc (the patch was committed
today, BTW).  Also, selecting "Regular expression" in the dialog box no longer
helps (previously it did).

This looks like an issue with the files included in search.  It seems that the
search results only include files that aren't opened.

Comment 16 Tony Tsui 2005-06-20 06:10:21 UTC
Hi,

I'm seeing the same behaviour with File Search that Ziga mentioned. The search
results only includes files which aren't opened.

I'm using:
- eclipse-platform-3.1.0_fc-0.RC2.2
- libgcj-4.0.0-9

Comment 17 Andrew Overholt 2006-01-17 16:45:18 UTC
This works for me now.  Should we close?  Does it not work for anyone?

Comment 18 Ziga Mahkovec 2006-01-27 22:24:54 UTC
(In reply to comment #17)
> This works for me now.  Should we close?  Does it not work for anyone?

Works for me as well with eclipse-platform-3.1.1-1jpp_1fc.FC4.12.  I think this
can be closed.

Comment 19 Andrew Overholt 2006-01-30 15:05:57 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > This works for me now.  Should we close?  Does it not work for anyone?
> 
> Works for me as well with eclipse-platform-3.1.1-1jpp_1fc.FC4.12.  I think this
> can be closed.

Great, thanks, Ziga!