Bug 507383

Summary: [templates] Java method templates do not create unique method names
Product: [Eclipse Project] JDT Reporter: Lars Vogel <Lars.Vogel>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, gautier.desaintmartinlacaze
Version: 4.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Lars Vogel CLA 2016-11-10 16:45:58 EST
If I use the Java templates for a method, e.g.,. a public method, it always creates the same method name ("name"). This results in syntax errors, after the second insert.

I suggest to generate unique names, like in for local variables which append a number, if another variables already exists with the same name.
Comment 1 Dani Megert CLA 2016-11-18 11:08:21 EST
A new variable newMethodName similar to newName and newType needs to be added.