Bug 32996 - Refactor->Extract constant should work on instance fields too [refactoring]
Summary: Refactor->Extract constant should work on instance fields too [refactoring]
Status: RESOLVED DUPLICATE of bug 52791
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-25 11:13 EST by Alex Blewitt CLA
Modified: 2007-06-21 04:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2003-02-25 11:13:50 EST
There isn't any reason why the Refactor->Extract Constant can't be used for
instance expressions as well as static expressions. An instance field declared
as final is still a constant.

Can the warning with 'cannot extract constant; non-static expression' be removed and changed
to generation of a non-static final field?

public class Example {
  public void examle() {
    this.toString(); // highlight 'this.toString()' and do a Refactor->Extract constant
  }
}
Comment 1 Dirk Baeumer CLA 2003-02-26 13:49:04 EST
Post 2.1
Comment 2 Martin Aeschlimann CLA 2007-06-21 04:26:06 EDT
reopen
Comment 3 Martin Aeschlimann CLA 2007-06-21 04:26:20 EDT

*** This bug has been marked as a duplicate of bug 52791 ***