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 247222

Summary: Organize imports: Duplicated static imports won't get removed
Product: java Reporter: markiewb
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal CC: markiewb
Priority: P3    
Version: 8.0.1   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Shows the issue

Description markiewb 2014-09-17 14:11:59 UTC
Created attachment 149301 [details]
Shows the issue

* See following classes
```
package com.foo;

public interface IFoo
{
    public enum PropertyType {
        Details,
        Key
    }
}
```

```
package com.bar;

import static com.foo.IFoo.PropertyType.*;
import static com.foo.IFoo.PropertyType.*;
import static com.foo.IFoo.PropertyType.*;
import static org.junit.Assert.*;

public class Bar
{
    private void method()
    {
        assertEquals("", Details);
    }

}
```
* configure the import order regarding the screenshot
* invoke organize imports for the file Bar.java

ACTUAL:
* duplicated static imports are NOT removed

EXPECTED:
* duplicated static imports are removed

Product Version: NetBeans IDE 8.0.1 (Build 201408142300)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Runtime: Java(TM) SE Runtime Environment 1.8.0-b132
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
Comment 1 Svata Dedic 2015-04-22 13:35:20 UTC
Fixed in jet-main#894b65304bad
Comment 2 Quality Engineering 2015-05-12 03:25:34 UTC
Integrated into 'main-silver', will be available in build *201505120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/894b65304bad
User: Svata Dedic <sdedic@netbeans.org>
Log: #247222: at most one star import is retained for organize imports
Comment 3 Marian Petras 2015-10-01 13:43:08 UTC
See also bug #254955 (Refactor/Rename duplicates static imports).