Community
Participate
Working Groups
Created attachment 236114 [details] .log file Hi, inserting a template that has the following statement will crash Eclipse to desktop: ${foo:newName(foo)} This happens only if the id and the parameter name are identical. A statement like below will work: ${foo:newName(bar)} I would assume that the first statement should be legal and work correctly. If it is for some reason not a legal statement, the template editor should report an error and not let me save the template. At the very least, Eclipse should not crash completely. I have attached the .log file for such a crash.
> I have attached the .log file for such a crash. Are you sure this is related to the crash? If so, can you please delete the .log, apply the template and then attach that .log. Please also look for a VM dump which probably gives more hints than the .log. In which editor do you apply the template?
Created attachment 236119 [details] Mac OS X crash report
I've been unable to create a vm dump for this. You can find a Mac OS X crash report attached.
Created attachment 236135 [details] Screen shots Attached. Could not test in Mac OS. Tested in Windows 7 using Eclipse build: I20130916-0900, attaching the error dialog displayed while inserting the template into the Java editor. The program goes into an infinite loop. Below is the stack trace: java.lang.StackOverflowError at org.eclipse.jface.text.templates.TemplateVariableType.getName(TemplateVariableType.java:52) at org.eclipse.jface.text.templates.TemplateVariable.getType(TemplateVariable.java:141) at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:269) at org.eclipse.jdt.internal.corext.template.java.JavaContext.getTemplateVariable(JavaContext.java:764) at org.eclipse.jdt.internal.corext.template.java.NameResolver.resolve(NameResolver.java:57) at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:273) at org.eclipse.jdt.internal.corext.template.java.JavaContext.getTemplateVariable(JavaContext.java:764)
Sorry I didn't spot this at the first read: you define a new id 'foo' and try to find a variable of type 'foo'. This seems to confuse the resolver, leading to a stack overflow - it does not crash the VM (at least on Windows with Oracle JRE 7). java.lang.StackOverflowError at java.util.Collections$UnmodifiableList.get(Collections.java:1211) at org.eclipse.jdt.internal.corext.template.java.NameResolver.resolve(NameResolver.java:55) at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:273) at org.eclipse.jdt.internal.corext.template.java.JavaContext.getTemplateVariable(JavaContext.java:764) at org.eclipse.jdt.internal.corext.template.java.NameResolver.resolve(NameResolver.java:57) at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:273) at org.eclipse.jdt.internal.corext.template.java.JavaContext.getTemplateVariable(JavaContext.java:764) at org.eclipse.jdt.internal.corext.template.java.NameResolver.resolve(NameResolver.java:57) at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:273) at org.eclipse.jdt.internal.corext.template.java.JavaContext.getTemplateVariable(JavaContext.java:764) at org.eclipse.jdt.internal.corext.template.java.NameResolver.resolve(NameResolver.java:57) at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:273) at ...
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.