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 231145 - Illegal 'Introduce Field...' is allowed
Summary: Illegal 'Introduce Field...' is allowed
Status: RESOLVED DUPLICATE of bug 205081
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-12 13:22 UTC by ssazonov
Modified: 2013-06-12 13:42 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 ssazonov 2013-06-12 13:22:34 UTC
1. Create class 'SimpleClass' and insert this code:

  //---------------------------
  public class SimpleClass {

      public final String SimpleConstant = "const";
      private String SimpleString = "";
    
      public SimpleClass(){
          SimpleString = "text";
      }
  }
  //---------------------------

2. Select "text"

3. Go to Refactor->Introduce Fields...

4. Set Name: 'SimpleConstant', Access: 'public', check 'Declare Final', Initialize in: 'Field', than press Ok

>> Constant SimpleConstant has been added, although is is already defined, so a bug is occured.

Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b30
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Jan Lahoda 2013-06-12 13:42:29 UTC

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