-
Bug
-
Resolution: Done
-
Major
-
4.24.0.Final
-
None
-
Sprint #225 Oct 2022
-
3
-
-
---
Symptoms
These are related problems, all dealing with the operation of the Code Templates (configure generated code and comments) capability of Eclipse IDE.
Symptom 1. The Preferences panel obtained by navigating from Java -> Code Style -> Code Templates does not expand the "Comments" and "Code" trees correctly.
When the ">" expand icon next to "Comments" is pressed, the icon disappears and no subtree is shown. It should show several templates for defining comments, such as File, Type, Getter, etc.
When the ">" expand icon next to "Code" is pressed, a subtree is shown but it is missing several templates, such as "New File".
Symptom 2. When a Code template is edited using the Preferences panel, the change is not saved after "Apply" and reverts to the default value.
Symptom 3. When the Code Template value within in the file
${Workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
is manually modified to the desired Code Templates, the Preferences panel still shows the default values and the Comment Generation process for a new Class still uses the default values.
Symptom 4. The "Generate comments" operation on the "New Java Class" dialog uses the default values, not the desired Code Template values.
Research
The default template being used is found in the JAR file
${EclipseHome}/plugins/org.eclipse.jdt.ui_*.jar
Internally at -- /templates/default-codetemplates.xml
It should be using the value defined within the Workspace (see above).