Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 196759

Summary: [templates][preferences] Customizied code templates aren't used until project specific settings are enable, tweaked, then disabled
Product: [Eclipse Project] Platform Reporter: Steve McKay <smckay>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P5 CC: caniszczyk, codesurgeon, konigsberg, martinae, michschn
Version: 3.3Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Steve McKay CLA 2007-07-16 21:25:18 EDT
Build ID: I20070625-1500

Steps To Reproduce:
The steps to reproduce are a bit lengthy, so hang in there.

1. Deploy eclipse with customized default java code templates:

# specify this in config.ini
eclipse.pluginCustomization = /some/file.ini

# specify this in /some/file.ini

org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// Copyright ${year} ACME Inc. All Rights Reserved.\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}@acme.com (Your Name Here)\n *\n * ${tags}\n */</template></templates>

2. User updates code template using preferences dialog (Java -> Code Style -> Code Templates, Comments -> Types:

/**
 * @author ${user}@acme.com (Joe Smith)
 *
 * ${tags}
 */
Apply. Create new class.

New class doesn't reflect changes to code templates. Instead it looks like the default values specified in our plugin customization file.

/**
 * @author ${user}@acme.com (Your Name Here)
 *
 * ${tags}
 */

3. User can work around the problem by clicking "Configure Project Specific Settings...", selecting a project. Checking "Enable project specific settings" box, clicking "Apply", then un-checking the "Enable project specific settings" box, then clicking OK.

After this, the values specified in the global settings are respected when new classes are created.

More information:
We deploy Eclipse using a set of default plugin preferences in a file specified using the "eclipse.pluginCustomization" property in config.ini.
Comment 1 Dani Megert CLA 2007-07-17 04:12:43 EDT
See also bug 94912.
Comment 2 Steve McKay CLA 2007-07-25 13:32:39 EDT
(In reply to comment #1)
> See also bug 94912.
> 

Can you point me in the direction of the relevant code? I'll snoop around and see if I can figure out what the problem is.
Comment 3 Dani Megert CLA 2007-07-26 02:54:45 EDT
Look at the TemplateStore that's managed by JDT UI:
JavaPlugin.getCodeTemplateStore() and at ProjectTemplateStore class.
Comment 4 Robert Konigsberg CLA 2007-12-11 21:18:08 EST
I'd like to nudge this issue a bit to see if perhaps we can make some headway.

I took a look at JavaPlugin.getCodeTemplateStore() and ProjectTemplateStore, but to be honest, I don't think I can make reasonable headway with just those two hints, unless you can point to what I'd need to specifically find.
Comment 5 Lars Vogel CLA 2019-09-24 13:58:37 EDT
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.
Comment 6 Eclipse Genie CLA 2021-10-06 17:31:01 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.