eclipse-jdt / eclipse-jdt/eclipse.jdt.ui
Java Comment Templates: Template does not load after restart when using git_config variable
- Dominant language
- Java
- Stars
- 59
- Forks
- 127
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 28
Description
Environment:
- Red Hat Enterprise Linux Server release 7.4 (Maipo)
- Eclipse Platform 4.15.0.I20200305-0155
- Eclipse Java Development Tools 3.18.300.v20200305-0155
- Git integration for Eclipse 5.7.0.202003110725-r
Steps:
1. Create a Java project
2. Go to Window > Preferences > Java > Code Style > Code Templates
3. Ensure "Automatically add comments for new methods, types, modules, packages and files" is checked
4. Select "Comments" > "Files", and click "Edit..."
5. In the Pattern field, insert text: /* myname: ${name:git_config(user.name)} */
6. Click OK, then Apply and Close
7. Create a few new classes and check the generated comments
8. Restart Eclipse
9. Create a few new classes and check the generated comments
10. Go to Window > Preferences > Java > Code Style > Code Templates
11. Select "Comments" > "Files", and observe the contents of the Pattern field
12. Create a few new classes and observe the generated comments
13. Go to Window > Preferences > Java > Code Style > Code Templates
14. Select "Comments" > "Files", and observe the contents of the Pattern field
Expected results:
- Custom comment template is loaded and applied correctly at steps 7,9,11,12,14
Actual results:
- Default comment template (instead of custom template) is loaded/applied incorrectly at steps 9,11.
- Custom comment template is still loaded and applied correctly at steps 7,12,14.
I started noticing this problem somewhere between releases 4.8 and 4.13.
Contributor guide
Assessment
This issue has not been assessed yet.