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 262292 - Organize Imports on save can break the code
Summary: Organize Imports on save can break the code
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-01 09:25 UTC by Maksim Khramov
Modified: 2016-06-01 11:39 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 Maksim Khramov 2016-06-01 09:25:47 UTC
Product Version: NetBeans IDE Dev (Build 201606010002)
Java: 1.8.0_102; Java HotSpot(TM) 64-Bit Server VM 25.102-b08
Runtime: Java(TM) SE Runtime Environment 1.8.0_102-b08
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

Steps to reproduce:

Take a source code:

package app.test.bulk.format;

import java.awt.*;
import java.util.*;
import java.util.List;

public class STest {

    private ArrayList<String> sarr;
    private List<String> strings;
    private Font font;

}

Enable Organize Imports on save option, made class modified and save it.
The java.util.List import is removed now and this breaks the code because the List class reference is ambiguous now.