Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 173364

Summary: [relengtool] "Fix Copyrights" action is mis-named, is IBM-specific, ignores template
Product: [Eclipse Project] Platform Reporter: Walter Harley <eclipse>
Component: RelengAssignee: Platform-Releng-Inbox <platform-releng-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P5 CC: david_williams, dj.houghton, eclipse, jeffmcaffer, johans, kim.moir, markus.kell.r, Michael.Valenta, mober.at+eclipse
Version: 3.3Keywords: helpwanted
Target Milestone: 3.5 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Walter Harley CLA 2007-02-07 17:47:46 EST
The "Fix Copyrights..." menu action contributed by org.eclipse.releng.tools has an ellipsis after its name.  This is an indication, by common UI standards, that it is going to bring up some sort of cancelable dialog before taking any action.  An example would be File -> Save As..., as compared to File -> Save.  Save As... takes ellipses because before it does anything it asks the user more questions.

However, selecting the action immediately starts processing all the files in the project.  This is a violation of UI guidelines.

Furthermore, if it finds any files without a copyright, it adds an IBM-specific copyright message without asking for confirmation.  (See IBMCopyrightComment.java.)  It does this even if the template in Window -> Preferences -> Copyright Tool is changed.

This is misleading for users, and unacceptable for Eclipse committers from outside of IBM.

Looking at the code, it appears that the "Advanced Fix Copyrights..." action is supposed to use the template from Preferences.  However, it's not visible on .java items or on projects; I'm only seeing it on non-Java files such as .properties or .map.  (It too appears to be misnamed but I can't get it to do anything anyway.)

Expected: (1) Action should be named "Fix Copyrights" without an ellipsis; (2) at the very least, it should use the template from preferences, but IMHO ideally  it should just add the file comment template, if one exists, and fail immediately with a warning if one does not exist.  It should NOT ever default to saying "IBM".
Comment 1 David Williams CLA 2007-02-07 18:13:03 EST
See also bug 77026. 

Comment 2 Walter Harley CLA 2007-02-07 18:24:02 EST
(In reply to comment #1)
> See also bug 77026. 

Thanks, David - yes, I also was getting bit because I use Package Explorer rather than Navigator.  So:

1. It would be good to make the Advanced action show up in both views.
2. The ellipsis should be removed from both actions.
3. The customizations requested in bug 77026 would be very nice, for the reasons expressed there.
Comment 3 DJ Houghton CLA 2007-02-08 06:29:32 EST
I am in the process of modifying the releng tools to handle the new map file format so since I am in that space if I get time I will look into the copyright part of it. 
Comment 4 DJ Houghton CLA 2007-02-21 10:30:01 EST
fyi: it looks like the Fix Copyright code is commented out with "disable fix up existing copyright till it works better". :-)
Comment 5 Kim Moir CLA 2007-04-11 21:05:29 EDT
*** Bug 149834 has been marked as a duplicate of this bug. ***
Comment 6 Jeff McAffer CLA 2008-11-07 11:00:37 EST
This is still an issue in the latest releng tools.  Using the Fix Copyrights menu option you get the IBM copyright (hardcoded as best I can tell).  Using the Advanced Copyright fix tool from the NAVIGATOR you get thr right behaviour.  

Is ther eany reason we have two?  Can someone just swap out the old menu entry and put in the new?
Comment 7 Michael Valenta CLA 2009-05-07 13:55:52 EDT
I suspect the reason there are two is because users of the Advanced Fix Copyright action don't have the time to verify that it works properly for the old Fix Copyright action. Since I don't have time either, I have renamed the Advanced Fix Copyright action to just Fix Copyright and the Eclipse/IBM specific on to Eclipse/IBM Fix Copyright. This should make it clear which on non-Eclipse or non-IBM users should use.
Comment 8 Walter Harley CLA 2009-05-08 02:29:39 EDT
A brilliant solution :-)

Thanks, Michael.
Comment 9 Martin Oberhuber CLA 2009-05-14 14:06:04 EDT
Is this change going to be released into 3.5 ?
At the moment it just sits in HEAD...
Comment 10 Michael Valenta CLA 2009-05-14 14:12:16 EDT
That would be up to the component lead I guess. Kim, do you want to release this change for 3.5? It just renames the two actions so things are more clear (or as clear as they can be through the limited text in an action name).
Comment 11 Kim Moir CLA 2009-05-14 14:59:59 EDT
tagged for next i-build.
Comment 12 John Arthorne CLA 2009-05-14 16:31:14 EDT
Just as a heads up, the big remaining difference I believe between the two actions is that the "IBM fix copyrights" will search your CVS history, and ignore commits that include the word "copyright" in it. This saves you from updating the copyright to a newer year just because the copyright were updated in that year (this causes copyrights to ripple and require updating every year).  If a non-IBM committer cares about this and fixes the "Advanced fix copyrights" to do the same, then I suspect we can turf the old one completely. 
Comment 13 Jeff McAffer CLA 2009-05-14 16:37:22 EDT
I have a vague recollection that there was another element of this:  the IBM one requires CVS whereas not everyone uses CVS.  So if someone does get up the energy to do the change please make it somehow optional so that people not using CVS can still get at least rudimentary support.
Comment 14 Michael Valenta CLA 2009-05-14 17:59:40 EDT
Actually, the Advanced version was modified to delegate the determination of the year to the repository provider. This allows the repository providers to determine what files have changed by comparing to a particular base (e.g. tag). This wasn't implemented for CVS but could be.
Comment 15 Michael Valenta CLA 2009-05-14 19:10:33 EDT
Sorry, I was a bit off on my last comment. The advanced version uses an interface that can be implemented by the repository provider to provide the modification year. This includes an initialization call to the repository provider that allows for the caching of the modification years. However, the CVS integration was not optimized to make use of this. For CVS this initialization could prompt for the text to look for in the commit comment or, better yet, could prompt for a tag to compare against to find files changed since the last release.
Comment 16 Kim Moir CLA 2009-05-22 15:19:31 EDT
*** Bug 180767 has been marked as a duplicate of this bug. ***