Bug 507383 - [templates] Java method templates do not create unique method names
Summary: [templates] Java method templates do not create unique method names
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-10 16:45 EST by Lars Vogel CLA
Modified: 2016-11-18 20:42 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.