Bug 4324 - EC: Find/replace gets stuck in infinite loop (1GLCBZE)
Summary: EC: Find/replace gets stuck in infinite loop (1GLCBZE)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Claude Knaus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 23:09 EDT by Nick Edgar CLA
Modified: 2002-01-16 08:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2001-10-10 23:09:48 EDT
From EC post: "Bug Report - Find/Replace" on Oct. 9, 2001.

I did a find/replace on "GUI_FONT" with "com.packagename.GUI_FONT" and got
stuck in an infinite loop as it kept trying to replace the new GUI_FONT
string over and over instead of moving on.

NOTES:
Comment 1 Kai-Uwe Maetzel CLA 2001-10-11 08:08:45 EDT
The only case I found in which this happens is repeatedly using Replace/Find 
when having wrap search enabled. This, however, is the intended behavior. Asked 
for more detailed information on EC.
Comment 2 Kai-Uwe Maetzel CLA 2001-10-24 04:41:42 EDT
From EC:

Ah haaa!

The secret is to click on the class name in the Outline view and then do the
find and replace (no boxes other boxes checked). I wasn't able to reproduce
the error either for a little bit, but there you have it.

Example code used (I click TestClass in the Outline area and did a
find/replace on TABLE_MODEL with Constants.TABLE_MODEL):
package testing;

import java.util.*;

public class TestClass {

private final static String TABLE_MODEL = "table model";

public static void main(String args[]) {

TestClass x = new TestClass();

x.doStuff();

}


public void doStuff() {

ArrayList temp = new ArrayList();

if ("tablemodel".equals(TABLE_MODEL))

return;

for (int i = 0; i < 100; i++)

temp.add(new Integer(i));

boolean didWeBreakHere = true;

}

}


Comment 3 Claude Knaus CLA 2002-01-10 06:17:28 EST
Nick,

Do you still have the e-mail of the person (EC?) who reported this bug?
I can't reproduce it. Otherwise I will close this bug with 'works-for-me'.
Comment 4 Nick Edgar CLA 2002-01-10 09:20:49 EST
EC stands for Eclipse Corner.
The poster was Charles Hasegawa <CurveWrecker@home.com>
Comment 5 Nick Edgar CLA 2002-01-10 09:21:19 EST
Since Kai came up with a reproducable case, did he perhaps already fix it?
Comment 6 Claude Knaus CLA 2002-01-15 12:58:02 EST
Thanks to Charles, I can finally reproduce it:

1. Open a class in the editor. I have the editor set to show each method rather 
than the whole source.
2. In the Outline View, click on the class name (the import and package 
information should "disappear").
3. Right-click anywhere in the editor window and select Find/Replace.
4. Enter the find and replace with strings. I do not change any of the options 
(default = none checked). The direction is by default = Forward.
5. Click the Replace All box and endless loop to your heart's content.
Comment 7 Claude Knaus CLA 2002-01-16 08:57:11 EST
fixed in integration build > 20020115