Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363171 - [xtend][ui][organize imports] required imports removed
Summary: [xtend][ui][organize imports] required imports removed
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.1.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-08 09:04 EST by Knut Wannheden CLA
Modified: 2017-09-19 17:51 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: juno+


Attachments
proposed patch (2.83 KB, patch)
2011-11-09 04:11 EST, Knut Wannheden CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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