This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257211 - Editor uses default template instead of modified template for existing class
Summary: Editor uses default template instead of modified template for existing class
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-18 14:31 UTC by fortiernor
Modified: 2015-12-18 15:33 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fortiernor 2015-12-18 14:31:41 UTC
I modified the template for classes. If I create a new class, the modified template is used. However If I add a javadoc comment to an existing class file that did not have such a comment before, the default comment is used instead of my modified template.

Expected: the modified template should be used.
Comment 1 Jiri Prox 2015-12-18 15:03:39 UTC
Can you please provide more detailed info?
What was content of editor before adding javadoc?
Which action did you use to generate javadoc?
What was the final state of editor?

Thanks
Comment 2 fortiernor 2015-12-18 15:21:14 UTC
Default template inserts my user name (linux session user name) after "@author ". Modified template inserts my full name after "@author ".

Content of editor was valid class file (*.java); that file contained no javadoc for class declaration (top of editor has package name then imports, then class declaration).

To generate javadoc I placed cursor on the line just above class declaration, then type "/**" then space. The editor then inserted the javadoc template but instead of showing "@author [full name]" (modified template) it shows "@author [session user name]".

I can reproduce with any class file: I delete the javadoc just above class declaration, then proceed as above (insert javadoc) with same result.

If I create a class file using menu item "New File..." / Java / Java class, then the file is created with modified template, including the correct javadoc with "@author [full name]".
Comment 3 Jiri Prox 2015-12-18 15:28:09 UTC
Thanks for info.

The problem is that generating javadoc with /** is not related to templates. 
Maybe there should be way how to configure "/**" javadoc stub.
Comment 4 fortiernor 2015-12-18 15:33:57 UTC
I see, that explains it. No big deal but I did find that behaviour counter-intuitive. Thank you.