Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 481912

Summary: Autocomplete inner interface
Product: [Eclipse Project] JDT Reporter: leokom leokom <lrozenblyum>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana
Version: 4.5.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description leokom leokom CLA 2015-11-11 04:19:34 EST
Let's have class B and class A:

package com.leokom.second;

public class B {
	public interface Inner {
		
	}
	
	public B( Inner somethingInside ) {
		
	}
}


package com.leokom.first;

import com.leokom.second.B;

public class A {
	public static void main( String[] args ) {
		B b = new B( new Inn );
	}
}

after typing new Inn in the code, Ctrl+space
First suggestion of autocompleter is B.Inner() (anonymous inner type) -> it's ok.

Press Enter to select this suggestion

EXPECTED:
public static void main( String[] args ) {
		B b = new B( new B.Inner() {
		} );
	}

ACTUALLY:
public static void main( String[] args ) {
		B b = new B( new Inner() {
		} );
	}

Code is not compiled.
IDE doesn't have resolving the issue by suggesting some wrong ideas to fix the problem: When pressing Ctrl+1 on the error it suggests 'Change constructor B(Inner) to B(Inner)' and 'Create constructor B(Inner)'
Comment 1 Jay Arthanareeswaran CLA 2015-11-17 02:48:46 EST
See the behavior on master. Moving to UI.
Comment 2 Eclipse Genie CLA 2019-10-18 07:04:13 EDT
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.