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

Bug 362458

Summary: [Xtend] unused imports warning confused by comment
Product: [Tools] Xtend Reporter: Sven Efftinge <sven.efftinge>
Component: CoreAssignee: Holger Schill <Holger.Schill>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Holger.Schill, vladdu55
Version: 2.2.0Flags: sven.efftinge: juno+
Target Milestone: RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sven Efftinge CLA 2011-10-31 05:01:52 EDT
Given the following file:
"""
import java.util.Collections

class X {
 
  def foo() {
    // some comment
    Collections::<String>emptyList
  }

}
"""

The import is wrongly marked as being unused.
Comment 1 Vlad Dumitrescu CLA 2012-05-09 03:15:51 EDT
Maybe this helps the investigation: changing to 

  def foo() {
    // some comment
    Collections::<String>emptyList
    Collections::<String>emptyList // or any other call on Collections
  }

makes the warning go away.

Also, not any static call on a class causes this (but I can't see a pattern).
Comment 2 Vlad Dumitrescu CLA 2012-05-09 04:10:25 EDT
Please ignore my previous comment, I should read the title of the bug too. Since the presence of the comment triggers this, it's also explaining the other cases...
Comment 3 Holger Schill CLA 2012-05-21 06:11:57 EDT
pushed fix and test to master
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:24:09 EDT
Requested via bug 522520.

-M.