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 258475 - organize imports: jumbled up imports
Summary: organize imports: jumbled up imports
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-22 04:34 UTC by maress
Modified: 2016-07-01 15:59 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 maress 2016-03-22 04:34:55 UTC
This bug is so hard to reproduce, but i have encountered it several times, that i think warrants it to be added here.

After doing some refactoring, specifically after moving a number of methods to a different class, and including this new class as an instance of the refactored class, the editor organize import messes up imports statements as shown here:

```
import java.io.Serializable;
javax.inject.Inject;
ist;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.enterprise.cmport javax.ws.rs.core.MediaType;

import static com.google.common.base.Preconditions.checkNotNull;
stScoped;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
```

Even after cleaning up the imports, adding them manually and then using ```CTR+SHIFT+I``` distorts the imports again.

Restarting netbeans may help, and sometimes may not.
Comment 1 Svata Dedic 2016-07-01 15:59:37 UTC
Could you please provide a source to test/reproduce the defect ?