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

Bug 350250

Summary: bogus error message "The declared package 'x.y.z' does not match the expected package"
Product: [Tools] Xtend Reporter: Stephan Herrmann <stephan.herrmann>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: benjamin.schwertfeger, sven.efftinge
Version: 2.2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Stephan Herrmann CLA 2011-06-24 09:08:16 EDT
I had a stock XText project in my workspace and in a runtime workbench
I tried to experiment with an xtend generator, so I copied the example
generator into the runtime workspace.

The XYZGenerator.xtend then showed the error:
  The declared package 'x.y.z' does not match the expected package

First, it would be very nice if the message shows *what* package was
actually expected. In my case however, the class was in the correct
package in a valid source folder. So the message actually gave no clue
to what was wrong.

It turns out the *only* way to get rid of the error: rename the class.
It *seems* that the tool was trying to tell me that this is a duplicate
class (because the version from the first workspace is in scope, too).

After all, why can't a local xtend class have the same qualified name
as one visible via a plug-in dependency?
Comment 1 Benjamin Schwertfeger CLA 2012-07-19 03:20:18 EDT
Thanks for your description. Even if I call maven without clean the error appears. Perhaps because the class is inside the xtend-gen and inside the temporary folder.
Comment 2 Sven Efftinge CLA 2013-09-12 09:18:52 EDT
I cannot reproduce this one.
Please reopen if it still happens and provide the steps needed to reproduce.
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:26:42 EDT
Requested via bug 522520.

-M.