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

Bug 457051

Summary: comment is discarded when reducing imports to an on-demand import
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, 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 11:41:03 EST
With on-demand threshold set to 2, uncommenting the Formatter line and auto-completing it (to java.util.Formatter) causes the comment to be discarded:

	package pack1;
	
	import java.util.Queue;
	
	/* floating comment */
	
	import java.util.concurrent.BlockingQueue;
	
	public class C {
		Queue<?> q;
		BlockingQueue<?> bq;
		// Formatter f;
	}

I expect "/* floating comment */" to be preserved between java.util.* and java.util.concurrent.BlockingQueue.

I observe that the comment is removed entirely.
Comment 1 John Glassmyer CLA 2015-01-08 11:41:27 EST
I am working on a fix.
Comment 2 Markus Keller CLA 2015-03-05 14:55:58 EST
Fixed via bug 430303.
Comment 3 shankha banerjee CLA 2015-03-18 01:38:26 EDT
Verified for 4.5 M6 with build I20150316-2000