Revision 1311

tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1311)
34 34
	 * Java keywords that can not be used as variable name.
35 35
	 * Also can not start by a number
36 36
	 */
37
	public static String illegalJavaStartingStr = "^([0-9]|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|false|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|null|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|true|try|void|volatile|while).*$";
37
	public static String illegalJavaStartingStr = "^([0-9]|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|false|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|null|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|true|try|void|volatile|while)$";
38 38
	
39 39
	/**
40 40
	 * 
......
194 194
			str = tmpString;
195 195
		}
196 196

  
197
		// java variable can not start by a number
198
		if(str.matches(illegalJavaStartingStr))	{
197
		// java variable can not start by a number and 
198
		if(str.matches(illegalJavaStartingStr) || str.matches("[0-9]+"))	{
199 199
			str = "_" + str;
200 200
		}
201
		
201
			
202 202
		// log
203 203
		if(debug)	{
204 204
			System.out.println("   => " + str);

Also available in: Unified diff