Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328817 - [content assist] Imports added twice when creating anonymous type
Summary: [content assist] Imports added twice when creating anonymous type
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 08:40 EDT by Markus Keller CLA
Modified: 2019-11-30 19:49 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-10-27 08:40:45 EDT
I20101026-2000

Imports are sometimes added twice when creating anonymous type via content assist.

Steps:
- have this class:

package xy;

import java.beans.PropertyChangeSupport;

public class ImportsBug {

    PropertyChangeSupport fProperty= new PropertyChangeSupport(this);
    
    void foo() {
           fProperty.addPropertyChangeListener(new P);
    }
}

- restore the Organize Imports properties for the project to defaults, then enable project-specific settings and remove all 4 entries in the table

- use Content Assist after "new P" to add the anonymous PropertyChangeListener

=> imports are (note the duplications):
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import java.beans.PropertyChangeSupport;
Comment 1 Eclipse Genie CLA 2019-11-30 19:49:53 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.