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 221949 - [Replace constructor with factory] No warning when refactoring enum constructor
Summary: [Replace constructor with factory] No warning when refactoring enum constructor
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 11:29 UTC by Jiri Prox
Modified: 2012-11-15 02:44 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 Jiri Prox 2012-11-12 11:29:04 UTC
There is no warning when replacing enum constructor with factory.

Steps to reproduce:

1) have a code:
public enum Enum {

    A(1);

    private Enum(int x) {
    }
}

2) replace constructor with factory

-> public enum Enum {

    A(1);

    private static Enum create(int x) {
        return new Enum(x);  // <--- here is error : Enum types cannot be instantiated 
    }

    private Enum(int x) {
    }
}


Product Version: NetBeans IDE Dev (Build 201211120001)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b15
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 1 Ralph Ruijs 2012-11-13 19:20:06 UTC
Changeset: a731c4302e42
Author:    Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Date:      2012-11-13 15:18
Comment 2 Quality Engineering 2012-11-15 02:44:03 UTC
Integrated into 'main-golden', will be available in build *201211150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a731c4302e42
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #221949 - [Replace constructor with factory] No warning when refactoring enum constructor