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

Bug 319867

Summary: Few issues in "Add ONLY Clause to USE Statement" refactoring (scrolling, bindings, variables not belonging to a module)
Product: [Tools] PTP Reporter: Maksym <petrenkomaxim>
Component: Photran.Refactoring EngineAssignee: Jeffrey Overbey <com-eclipse-dot-org>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P2 CC: arossi, com-eclipse-dot-org, titaniumlou
Version: 6.0   
Target Milestone: 8.1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 318741, 399314, 406988    
Bug Blocks:    
Attachments:
Description Flags
proposed patch
none
updated patch none

Description Maksym CLA 2010-07-14 11:22:04 EDT
"Add ONLY Clause to USE Statement" refactoring has a dialog that lists all functions and variables of a selected module. The user clicks / unclicks checkboxes for the variables and functions that he wants in the USE ONLY statement. The dialog has no scroll bars, so when the selected module has a lot of variables / functions - the user can see only a portion of them. A simple vertical scroll bar should fix the problem.

After clicking "Preview", the refactoring checks for conflicting bindings - in my project (about 50 files), this often looks like an endless loop - the "Analyzing ..." status bar displays the same files over and over (that is, re-checks files that it already checked). Nonetheless, it is not endless - after few minutes, it does produce a warning window listing about 30 problems, all being identical (same file, and same line). This probably stems from the fact that this refactoring tries to include in ONLY no just the variables and functions defined in the analyzed module itself, but also those defined in the other modules used by the analyzed module. Perhaps, the user should be presented with two separate selection lists - one for the native definitions of the module, and one for the through definitions.
Comment 1 Louis Orenstein CLA 2013-01-28 16:32:21 EST
I split off the 1st part of this bug (the scrolling issue when there are lots of variables or functions in a module) to bug 399314
Comment 2 Louis Orenstein CLA 2013-01-30 17:22:37 EST
changes under bug 399565 are probably related
Comment 3 Louis Orenstein CLA 2013-01-31 19:03:36 EST
Two resolutions come to mind for the "Analyzing..." issue described below:
- make the messaging more clear in case the same file is being analyzed multiple times but for different vars/functions
- only present the user with the native definitions of the module, and remove the "through" definitions from the checklist
- optimize the analysis (still investigating if that's a possibility)
Comment 4 Louis Orenstein CLA 2013-02-10 15:32:22 EST
Created attachment 226814 [details]
proposed patch
Comment 5 Jeffrey Overbey CLA 2013-02-13 13:07:12 EST
Hi Lou,

I have a small request... please modify your patch so that

(1) you are listed as one of the contributors in the copyright header of any affected files (e.g., "Louis Orenstein (Tech-X Corporation) - Fix for Bug 319867" or something similar), and
(2) you are listed as an @author in the JavaDoc for any affected classes.

(These are required by the IP team at the Eclipse Foundation.)

After you submit the modified patch, please confirm that

(a) you wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others,
(b) you have the right to contribute the code to Eclipse, and
(c) you have included the EPL license header in all source files.

Thanks!
Comment 6 Louis Orenstein CLA 2013-02-19 09:19:31 EST
Created attachment 227253 [details]
updated patch

updated contributors and javadoc authors sections, and includes some changes from bug 400272 since those changes were part of the overall refactoring

I confirm that:

(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others.
(b) I have the right to contribute the code to Eclipse.
(c) I have included the EPL license header in all source files.
Comment 7 Jeffrey Overbey CLA 2013-04-29 18:19:18 EDT
This is a small patch, so I was able to commit it without a full IP review.  Thanks again, Lou.

Applied in master for Kepler GA.
Comment 8 Jeffrey Overbey CLA 2013-04-29 18:20:45 EDT
I copy and pasted too quickly.  I was not able to apply the patch for this and Bug 400272... discussing with Louis offline...
Comment 9 Jeffrey Overbey CLA 2013-05-01 10:20:51 EDT
Committed to master for Photran 8.1/Kepler.

Thanks, Louis!