Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-28648

Comment generation from Code Templates not working Eclipse 2022-06 and -09

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.25.0.Final
    • 4.24.0.Final
    • common
    • None
    • Sprint #225 Oct 2022
    • 3
    • Hide

      The problem appeared after upgrading my Eclipse IDE and Extensions (AsciiDoctor, SonarLint, and JBoss Tools). This brought my install to the following versions:

      • Eclipse IDE 2022-06 for JEE
      • Java JDK 17
      • AsciiDoctor 2.7.0
      • SonarLint 7.5.0
      • JBoss Tools 4.24.0

      I installed a fresh copy of Eclipse IDE for JEE 2022-06. No extensions. The Code Templates behaved correctly.

      I installed AsciiDoctor to Eclipse IDE via Marketplace. The Code Templates behaved correctly.

      I installed SonarLint for Eclipse IDE via Marketplace. The Code Templates behaved correctly.

      I installed JBoss Tools for Eclipse IDE via Marketplace. The Code Templates failed as described above.

      I uninstalled JBoss Tools using Marketplace. The Code Templates resumed correct behavior.

      Therefore, I isolated the Code Templates incorrect behavior to the JBoss Tools.

      Show
      The problem appeared after upgrading my Eclipse IDE and Extensions (AsciiDoctor, SonarLint, and JBoss Tools). This brought my install to the following versions: Eclipse IDE 2022-06 for JEE Java JDK 17 AsciiDoctor 2.7.0 SonarLint 7.5.0 JBoss Tools 4.24.0 I installed a fresh copy of Eclipse IDE for JEE 2022-06. No extensions. The Code Templates behaved correctly. I installed AsciiDoctor to Eclipse IDE via Marketplace. The Code Templates behaved correctly. I installed SonarLint for Eclipse IDE via Marketplace. The Code Templates behaved correctly. I installed JBoss Tools for Eclipse IDE via Marketplace. The Code Templates failed as described above. I uninstalled JBoss Tools using Marketplace. The Code Templates resumed correct behavior. Therefore, I isolated the Code Templates incorrect behavior to the JBoss Tools.
    • ---

      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).

            jmaury@redhat.com Jeff MAURY
            vickimfox Michael Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: