Bug 316809 - [plan] [refactoring] Pull Out Refactoring: handling of abstract methods
Summary: [plan] [refactoring] Pull Out Refactoring: handling of abstract methods
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.1.1   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 277055
  Show dependency tree
 
Reported: 2010-06-14 15:15 EDT by Kris De Volder CLA
Modified: 2010-07-26 13:53 EDT (History)
1 user (show)

See Also:


Attachments
Patch: implementing this feature + tests (25.52 KB, patch)
2010-07-23 16:58 EDT, Kris De Volder CLA
no flags Details | Diff
Update: remove some dead/unused code from previous patch (24.38 KB, patch)
2010-07-23 17:04 EDT, Kris De Volder CLA
andrew.eisenberg: iplog+
Details | Diff
Fixes a broken test case (2.44 KB, patch)
2010-07-24 14:25 EDT, Kris De Volder CLA
andrew.eisenberg: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kris De Volder CLA 2010-06-14 15:15:29 EDT
Build Identifier: 

The initial implementation of pull-out refactoring does not support pulling out of abstract / interface methods.

When such methods are being pulled out, they will cause compile errors in the resulting code.

A way to handle this case could be as follows:

 - provide an option in the wizard to enable/allow pulling abstract methods
 - if the option is not enabled report an error/warning when abstract methods are selected for pull-out.
 - if the option is enabled, do not report an error, but pull the method out, removing the abstract keyword and provide a stub implementation in the refactored code.

Reproducible: Always
Comment 1 Kris De Volder CLA 2010-07-23 16:58:20 EDT
Created attachment 175106 [details]
Patch: implementing this feature + tests

I'm attaching a patch that imlements pulling out support for abstract and interface methods.

Does the following:

 a) when we do not select the "generate abstract method stubs" option
   - produce warnings for any abstract or interface methods
   - if you refactor anyway
      - ads abstract+public keyword to interface methods that don't already 
        have it
      - create an "abstract" itd that will cause compile errors that user can then
        look at and address.

 b) when we *do* select generate abstract method stubs
   - removes abstract keyword
   - adds a method stub that throws an Error when called
Comment 2 Kris De Volder CLA 2010-07-23 17:04:48 EDT
Created attachment 175107 [details]
Update: remove some dead/unused code from previous patch
Comment 3 Andrew Eisenberg CLA 2010-07-23 18:39:43 EDT
Patch is applied and committed.

It looks like this bug should be closed. No?
Comment 4 Kris De Volder CLA 2010-07-24 12:16:20 EDT
Yes. Thanks for committing the patch
Comment 5 Kris De Volder CLA 2010-07-24 14:24:52 EDT
Reopening. It looks like my patch contained a broken test case.

Something must have gone wrong when I created the patch, it seems to contain an older, broken version of the testcase from my local history.

I'm attaching a patch that fixes the test case.
Comment 6 Kris De Volder CLA 2010-07-24 14:25:57 EDT
Created attachment 175162 [details]
Fixes a broken test case
Comment 7 Andrew Eisenberg CLA 2010-07-26 13:52:08 EDT
Patch is applied.
Comment 8 Andrew Eisenberg CLA 2010-07-26 13:53:41 EDT
committed.