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
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
Depends on:
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:


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;


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) {

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 <>
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 (upload may still be in progress)

User: Ralph Benjamin Ruijs <>
Log: #239347 - [Extract Interface] Shold add necessary imports to interface