Bug 140342 - Never Ending Loop during Build of a project
Summary: Never Ending Loop during Build of a project
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-05 08:32 EDT by Johannes CLA
Modified: 2006-05-07 08:25 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes CLA 2006-05-05 08:32:36 EDT
I run in a Never-Ending-Loop if I "Save" this in Eclipse and the "Build Automatically" is switched on.
The only way to stop this is to kill Eclipse or the Build Progress. 
If I rename the local String variable "name" or use the instance variable instead, there is no issue.
BTW, I am not the author but the reviewer of this code :(

Funny enough, the javac do not complain and it seems to be executable code.
This may related to Bug Report 34173 .


----------------------------------------------
import java.util.StringTokenizer;

public class TestGenerateFunctionName {
	private String name = null;
	

	/**
	 * Method generateFunctionName
	 * This method is generating JavaScript Function name for this button.
	 * @return
	 * String
	 */
	private String generateFunctionName() {
		StringTokenizer strToken = new StringTokenizer(name, " ");
		StringBuffer functionName = new StringBuffer();
		functionName.append("on");
		if (strToken.countTokens() > 1) {
			while(strToken.hasMoreTokens()) {
				functionName.append(strToken.nextToken());
			}
		}
		else {
			functionName.append(name);
		}

		String name = functionName.toString();

		//For Special Chars
		strToken = new StringTokenizer(name, "/");
		if (strToken.countTokens() > 1) {
			functionName = new StringBuffer();
			while(strToken.hasMoreTokens()) {
				functionName.append(strToken.nextToken());
			}
		}
		return functionName.toString();

	}

}
Comment 1 Philipe Mulet CLA 2006-05-05 09:08:29 EDT
I cannot reproduce either with 3.1.2 or 3.2(HEAD).
What build ID and settings are you using ?
Comment 2 Johannes CLA 2006-05-05 10:57:01 EDT
I was using
Version: 3.1.0
Build id: I20050627-1435

The defect is not reproducable with 3.1.2 
Thanks for your quick reply !
Comment 3 Philipe Mulet CLA 2006-05-07 08:25:22 EDT
Excellent, thanks for confirming.