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 31836 - Missing license suggestions
Summary: Missing license suggestions
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-10 17:56 UTC by _ pkuzel
Modified: 2003-03-19 05:53 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 _ pkuzel 2003-03-10 17:56:49 UTC
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
Comment 1 Torbjorn Norbye 2003-03-14 05:34:11 UTC
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.
Comment 2 _ pkuzel 2003-03-17 12:31:25 UTC
#, !, /**/ or <!-- --> is not a part of the copyright itself.
Comment 3 Torbjorn Norbye 2003-03-17 15:58:02 UTC
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.
Comment 4 _ pkuzel 2003-03-17 17:26:57 UTC
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.
Comment 5 Torbjorn Norbye 2003-03-19 05:47:01 UTC
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.
Comment 6 Torbjorn Norbye 2003-03-19 05:53:47 UTC
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.