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 239347 - [Extract Interface] Shold add necessary imports to interface
Summary: [Extract Interface] Shold add necessary imports to interface
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-11 09:21 UTC by ssazonov
Modified: 2014-02-14 10:36 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-12-11 09:21:29 UTC
1. Create simple java class:

package test;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class ClassA {

    public void m3() throws FileNotFoundException, IOException {
        BufferedReader br = new BufferedReader(new FileReader("C:\\test.txt"));
        String s;
        while ((s = br.readLine()) != null) {
            System.out.println(s);
        }
    }
}

2. Right click the body of ClassA and from pop-up menu select Refactor > Extract Interface

3. Type name "MyInterface", check method m3() and press Refactor

>> There are missing imports in interface:

package test;

public interface MyInterface {

    void m3() throws FileNotFoundException, IOException;
    
}

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Ralph Ruijs 2014-01-07 22:52:53 UTC
changeset   : fa8c90feb37a
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Tue Jan 07 23:46:57 CET 2014
summary     : #239347 - [Extract Interface] Shold add necessary imports to interface
Comment 2 Quality Engineering 2014-01-09 02:57:05 UTC
Integrated into 'main-silver', will be available in build *201401090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/fa8c90feb37a
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #239347 - [Extract Interface] Shold add necessary imports to interface