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 262358

Summary: Fix Imports contains duplicates
Product: java Reporter: _ gtzabari <gtzabari>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description _ gtzabari 2016-06-08 01:36:00 UTC
Product Version: NetBeans IDE Dev (Build 201606020002)
Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14
System: Windows 10 version 10.0 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

1. Given a Maven project that depends on:

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.4.1</version>
        </dependency>

2. Create the following class:

public class NewClass {

    public static void main(String[] args) {
        assertThat("foo").isEqualTo("bar");
    }
}

3. Trigger "Fix All Imports"
4. The combo-box will contain 20-30 duplicates per possible combination of "assertThat".

My guess is that Netbeans is generating one entry per method signature. I am expecting it to generate a single entry per method name, regardless of the method signature.