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

Bug 457089

Summary: imports are improperly reordered in the presence of a floating comment
Product: [Eclipse Project] JDT Reporter: John Glassmyer <eclipse>
Component: CoreAssignee: John Glassmyer <eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.sprigogin, jarthana, manoj.palat, markus.kell.r, shankhba
Version: 4.4.1   
Target Milestone: 4.5 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 430303    

Description John Glassmyer CLA 2015-01-08 17:27:26 EST
With configured import order ["java", "javax"], running Organize Imports on the following compilation unit moves the javax.sql.DataSource import above the java.util.List import. (Running Organize Imports a subsequent time moves DataSource back to its correct position below List.)

I expect Organize Imports to leave these import declarations in their existing (already sorted) order.

	package pack1;
	
	import java.io.Serializable;
	
	/* floating comment */
	
	import java.util.List;
	
	import javax.sql.DataSource;
	
	public class C {
		Serializable s;
		List<?> l;
		DataSource ds;
	}
Comment 1 John Glassmyer CLA 2015-01-08 17:27:42 EST
I'm working on a fix for this.
Comment 2 Jay Arthanareeswaran CLA 2015-01-08 23:15:55 EST
Thanks John!

Manoj, please work with John to take this to closure.
Comment 3 Markus Keller CLA 2015-03-05 14:56:20 EST
Fixed via bug 430303.
Comment 4 shankha banerjee CLA 2015-03-18 01:20:16 EDT
Verified for 4.5 M6 with build I20150316-2000.