Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362458 - [Xtend] unused imports warning confused by comment
Summary: [Xtend] unused imports warning confused by comment
Status: CLOSED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: RC1   Edit
Assignee: Holger Schill CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-31 05:01 EDT by Sven Efftinge CLA
Modified: 2017-10-31 11:24 EDT (History)
2 users (show)

See Also:
sven.efftinge: juno+


Attachments

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