This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 254902 - Pull Up Method Refactoring makes a class abstract
Summary: Pull Up Method Refactoring makes a class abstract
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-01 11:27 UTC by melmongiovi
Modified: 2015-09-01 11:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description melmongiovi 2015-09-01 11:27:21 UTC
Applying pull up method refactoring to move B.m to class A, makes A abstract.
Making a class abstract may be not safe in some domains, such as, library (API) developments.  Even, in other domains, the developer may not want to make a class abstract. I think at least NetBeans should report a message to alloy the user choosing between make a class abstract or give up the transformation.

Before Refactoring:

public class A {}
abstract class B extends A {
  public abstract int m(int a);
}


Resulting Program:

public abstract class A {
  public abstract int m(int a); 
}

abstract class B extends A {}