Community
Participate
Working Groups
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(); } }
I cannot reproduce either with 3.1.2 or 3.2(HEAD). What build ID and settings are you using ?
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 !
Excellent, thanks for confirming.