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

Bug 497508

Summary: Duplicate problem is reported when import declarations are using in module source type.
Product: [ECD] Orion Reporter: Olivier Thomann <Olivier_Thomann>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 12.0   
Target Milestone: 13.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Olivier Thomann CLA 2016-07-07 12:37:25 EDT
Try this source:

import "somelib";

function test(){
}

With sourceType being set to "module".

You can see duplicate annotations being reported for "test" not being read. This annotation should be reported only once.
Comment 1 Michael Rennie CLA 2016-07-07 14:39:54 EDT
Perhaps related to: https://bugs.eclipse.org/bugs/show_bug.cgi?id=495712?
Comment 2 Curtis Windatt CLA 2016-07-07 16:41:16 EDT
*** Bug 497504 has been marked as a duplicate of this bug. ***
Comment 3 Curtis Windatt CLA 2016-07-07 16:48:30 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=92b6e2a12cf90fb45590335e76565f99a106176e
Fixed in master plus test

(In reply to Michael Rennie from comment #1)
> Perhaps related to: https://bugs.eclipse.org/bugs/show_bug.cgi?id=495712?

Yes, this is the same issue.  The fix for 495712 didn't apply when the sourceType modules was set, but the same scope was being checked twice.  fix is to always skip the checking the import node.  Unused imports and vars are handled in the program node check.