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

Bug 363171

Summary: [xtend][ui][organize imports] required imports removed
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.1.0Flags: sebastian.zarnekow: juno+
Target Milestone: M4   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
proposed patch none

Description Knut Wannheden CLA 2011-11-08 09:04:05 EST
In the following Xtend2 example:

import org.eclipse.xtext.resource.IResourceServiceProvider
import org.eclipse.emf.ecore.EPackage

class Test {
	def foo() {
        val x = IResourceServiceProvider$Registry::INSTANCE
    	val y = EPackage$Registry::INSTANCE
	}
}

running organize imports will remove the import for EPackage. It seems to be related to the fact that both imported types have a nested Registry interface. Somehow organize imports seems to get confused because of that.

Also note that there is no warning on either of the imports in this source, which of course is correct.
Comment 1 Knut Wannheden CLA 2011-11-09 04:11:28 EST
Created attachment 206654 [details]
proposed patch
Comment 2 Sebastian Zarnekow CLA 2011-11-09 10:46:29 EST
Patch looks good. Please apply on master and maintenance branch.
Comment 3 Knut Wannheden CLA 2011-11-10 07:51:06 EST
Pushed proposed patch to master and 2.1.x_Maintenance.
Comment 4 Karsten Thoms CLA 2017-09-19 17:39:52 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:51:08 EDT
Closing all bugs that were set to RESOLVED before Neon.0