Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 298134 - New refactoring for Fortran - Data To Parameter
Summary: New refactoring for Fortran - Data To Parameter
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Refactoring Engine (show other bugs)
Version: 5.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 6.0   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-17 17:49 EST by Gustavo Rissetti CLA
Modified: 2010-03-05 10:56 EST (History)
2 users (show)

See Also:


Attachments
Data To Parameter source code. (13.79 KB, text/x-java)
2009-12-17 17:49 EST, Gustavo Rissetti CLA
no flags Details
Data To Parameter source code (with EPL license header). (14.35 KB, text/x-java)
2009-12-17 19:09 EST, Gustavo Rissetti CLA
no flags Details
Data To Parameter source code (with correct EPL license header). (14.27 KB, text/x-java)
2009-12-17 19:20 EST, Gustavo Rissetti CLA
com-eclipse-dot-org: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Rissetti CLA 2009-12-17 17:49:56 EST
Created attachment 154722 [details]
Data To Parameter source code.

Refactoring to transform variables declared as data in variables declared with parameter attribute, when these are intended to be constants in source code. Often, developers who want to use constants can confuse the data statement with the attribute parameter, which is the most suitable in these cases. Making the substitution can generate performance gains, because it decreases the access to variables.
Comment 1 Jeffrey Overbey CLA 2009-12-17 18:16:05 EST
Hi Gustavo,

Thanks for the contribution.  Can you please confirm that

1. you wrote 100% of the code without incorporating content from elsewhere or
relying on the intellectual property of others,

2. you have the right to contribute the code to Eclipse, and

3. you have included the EPL license header in all source files?

(Please reply with a comment on this bug; you can just say, "I confirm that I wrote 100%..." and repeat these points.  This is for our intellectual property review.  For #1, if some of your code is borrowed from or based on someone else's code, please state that explicitly.)

Thanks.
Jeff
Comment 2 Gustavo Rissetti CLA 2009-12-17 19:09:39 EST
Created attachment 154730 [details]
Data To Parameter source code (with EPL license header).

Refactoring to transform variables declared as data in variables declared with
parameter attribute, when these are intended to be constants in source code.
Often, developers who want to use constants can confuse the data statement with
the attribute parameter, which is the most suitable in these cases. Making the
substitution can generate performance gains, because it decreases the access to
variables.
Comment 3 Gustavo Rissetti CLA 2009-12-17 19:11:02 EST
(In reply to comment #1)

I confirm that I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others, and I have the right to contribute the code to Eclipse, and I have included the EPL license header in all source files.

> Hi Gustavo,
> 
> Thanks for the contribution.  Can you please confirm that
> 
> 1. you wrote 100% of the code without incorporating content from elsewhere or
> relying on the intellectual property of others,
> 
> 2. you have the right to contribute the code to Eclipse, and
> 
> 3. you have included the EPL license header in all source files?
> 
> (Please reply with a comment on this bug; you can just say, "I confirm that I
> wrote 100%..." and repeat these points.  This is for our intellectual property
> review.  For #1, if some of your code is borrowed from or based on someone
> else's code, please state that explicitly.)
> 
> Thanks.
> Jeff
Comment 4 Gustavo Rissetti CLA 2009-12-17 19:20:27 EST
Created attachment 154735 [details]
Data To Parameter source code (with correct EPL license header).
Comment 5 Jeffrey Overbey CLA 2009-12-18 14:43:31 EST
Since the contribution is fewer than 250 LOC, we will not need to go through the full IP review process for this refactoring.  (Attachment is 238 LOC.)
Comment 6 Jeffrey Overbey CLA 2009-12-18 14:48:07 EST
Gustavo,

Could you please add a description of this refactoring to Section 4 of the Photran 6.0 Advanced Features manual, so our users will know how to use it and what they should expect it to do?

http://wiki.eclipse.org/PTP/photran/documentation/photran6advanced

You can look at the descriptions of some other refactorings for examples.  Thanks in advance!

I will review your code and check it into CVS as soon as possible.

Jeff
Comment 7 Jeffrey Overbey CLA 2010-01-15 17:54:09 EST
This refactoring has been committed to CVS, and Tim wrote some unit tests.  I still need to review the code and documentation before closing this bug...
Comment 8 Jeffrey Overbey CLA 2010-03-05 10:41:15 EST
I did some heavier refactoring on this one.  Nothing substantive -- the logic/AST manipulations are the same -- but I factored out some of the code into two method objects to make the field purposes/lifetimes clearer and broke it into smaller methods.

Gustavo, please run a couple of tests on this to make sure I didn't break anything accidentally.  I tried to not change the string and AST manipulations at all, but I might have missed something.  Thanks.

Still need to do doc review...
Comment 9 Jeffrey Overbey CLA 2010-03-05 10:56:47 EST
Done.  Thanks again for all your work, Gustavo!  We really appreciate the contribution!