Bug 140342

Summary: Never Ending Loop during Build of a project
Product: [Eclipse Project] JDT Reporter: Johannes <Johannes.Bellert>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.