Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse Refactoring (How does Eclipse Re-Analyse source code after Refactoring?)
icon5.gif  Eclipse Refactoring [message #644556] Mon, 13 December 2010 04:35 Go to next message
Dharam  is currently offline Dharam
Messages: 18
Registered: December 2010
Junior Member
Hello All!

1. Eclipse uses AST based concept for Refactoring. Refactoring is a "Complete Operation",
- Preceded by set of Preconditions
- Transformation
- Follwed by set of PostConditions

Example:
After applying "Rename Variable" refactoring, Eclipse immediately makes impact analysis & changes the source code

Queries:
Does it also change AST?

If Yes, then it must unparse AST & perform re-analysis to collect results based on new change,

But I am wondering how eclipse does it too fast. For millions of lines of code, static analyis takes lots of time.

Analysis means:
Variable Use
Variable Def
Aliasing Info
Call Graph
gen kill
reaching & liveness
etc...

[Updated on: Mon, 13 December 2010 07:23]

Report message to a moderator

Re: Eclipse Refactoring [message #644635 is a reply to message #644556] Mon, 13 December 2010 09:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25919
Registered: July 2009
Senior Member
Dharam,

Comments below.

Dharam wrote:
> Hello All!
>
> 1. Eclipse uses AST based concept for Refactoring. Refactoring is a
> "Complete Operation", - Preceded by set of Preconditions
> - Transformation
> - Follwed by set of PostConditions
>
> Example:
> After applying "Rename Variable" refactoring, Eclipse immediately
> makes impact analysis & changes the source code?
>
> Queries:
> Does it also change AST?
Yes.
>
> If Yes, then it must unparse AST & perform re-analysis to collect
> results based on new change,
The analysis is done using the AST.
>
> But I am wondering how eclipse does it too fast. For millions of
> lines of code, static analyis takes lots of time.
The incremental compiler is very smart and knows where to focus the
attention.
>
> Analysis means:
> Variable Use
> Variable Def
> Aliasing Info
> Call Graph gen kill reaching & liveness
> etc...
Re: Eclipse Refactoring [message #644747 is a reply to message #644635] Tue, 14 December 2010 00:06 Go to previous message
Dharam  is currently offline Dharam
Messages: 18
Registered: December 2010
Junior Member
Thanks.

I agree with you, changing & unparsing AST is somewht starightforward task. But collecting static analysis results each time after refactoring very expensive,

def use / use def
gen kill
aliasing info for each reference variable
liveness
reaching.

Would you pls eloborate more on this? I would also like to request if you can suggest me eclipse library for static analyis used in refactoring.
Previous Topic:Problem with imports
Next Topic:Search results list
Goto Forum:
  


Current Time: Fri Jul 25 19:11:21 EDT 2014

Powered by FUDForum. Page generated in 0.02294 seconds