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.
Issue #31657 conluded that it would be good task list enhancement. Default auto correction action could be to fill clipboard by licence file from settings. Task list solution could share settings with issue #13250
I've "partially" implemented this - if you open a file that doesn't have a copyright, a task is listed stating just that (missing copyright / license). However, there's no autofix for it (yet). The UI for how that should work should probably be discussed (if I interpreted you correctly, it should yank in a license from the clipboard? Or perhaps you were saying there would be a setting pointing to a license file?). Another possibility might be to automatically peek at other files in the same directory, try to extract their copyrights and offer these as possibilities to be duplicated. One advantage of this is that it might work better for different file types - e.g. if you're looking at a Bundle file, I might find other bundle files in the vicinity, and so I get a copyright using "#" instead of "/*" as comment escape strings.
#, !, /**/ or <!-- --> is not a part of the copyright itself.
I'm not sure what you mean by "#, // etc. not part of the copyright". My point was that let's say the copyright is the SPL. And let's say that when I click on the "Copyright Missing" suggestion, it attempts to insert a copyright. If the current file is a Java file, it can insert /** <copyright> */ but if the file is a Bundle.properties file, it has to begin each and every line with a # # # <copyright> # For XML files, it probably even has to skip the encoding line: <?xml version="1.0" encoding="UTF-8"?> <!-- <copyright> --> That's the complexity I was talking about - but now that I think about it, there probably aren't THAT many source file types to worry about. And, we already deal with this problem to a small extent: in order to support the feature which lets you list TODO,FIXME,XXX,PENDING etc. that occur only in comments, we already do some simple file type checking and conditional comment string processing.
I meant that the comment itself must be surrounded by some extra chars that depends on file type. Another approach (in my opinion worse) is to have extra license per file type.
Implemented (tasklist/docscan module, v1.4). I don't want to describe how it works since I'm hoping it's obvious - open a file without a copyright and see if it's clear, if not I'd like to hear about it.
Btw, for XML files it inserts the copyright at the top, not inside content like encoding or doctype. I didn't want to get in the game of knowing a lot about different filetypes and their structure. The tasklist/html module will give you warnings about this anyway so you know that this needs to change.