Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 463822 - Syntax error after Eclipse 4 RCP template generation
Summary: Syntax error after Eclipse 4 RCP template generation
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.5 RC1   Edit
Assignee: Olivier Prouvost CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 466269 (view as bug list)
Depends on: 463821
Blocks:
  Show dependency tree
 
Reported: 2015-04-02 11:06 EDT by Lars Vogel CLA
Modified: 2015-05-20 09:51 EDT (History)
4 users (show)

See Also:
Lars.Vogel: review+
olivier.prouvost: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2015-04-02 11:06:38 EDT
If I generate a project with the Eclipse 4 RCP template from Bug 441331 the package name is not replaced, its reamains "packageName".
Comment 1 Olivier Prouvost CLA 2015-04-02 11:28:14 EDT
I will check it..
Comment 2 Olivier Prouvost CLA 2015-04-02 13:59:38 EDT
Lars,  I can not reproduce it if my configuration is good.

Could you check if you have an instance of an imported 'org.eclipse.ui' project in your workspace that would be launched instead the default one ? I had this problem when my org.eclipse.pde.ui could not compile because I had an old version of 'org.eclipse.ui', so the configuration was not good... 
Can you check you have no error in your workspace ? 

It works well for me  

My configuration is : 

Java 8 by default
Nightly build (310315) of SDK
latest commit version of eclipse.pde.ui (1522d90fda41a56a57d256a2ad2357ddbeef69f4)
Mac os X Yosemite
Comment 3 Olivier Prouvost CLA 2015-04-02 14:02:54 EDT
Ok.. I got the use case. 

The packageName is not replaced if you say you don't want an activator which is generated while not expected...

This bug will be fixed when the bug #463821 will be fixed !
Comment 4 Olivier Prouvost CLA 2015-04-02 18:42:59 EDT
Fixed with bug #463821
Comment 5 Lars Vogel CLA 2015-04-07 06:12:15 EDT
.

*** This bug has been marked as a duplicate of bug 463821 ***
Comment 6 Lars Vogel CLA 2015-04-28 05:04:29 EDT
This is still wrong, if I generate a project without activator the resulting project still has an incorrect package name.

package packageName.handlers;
Comment 7 Eclipse Genie CLA 2015-04-28 12:20:47 EDT
New Gerrit change created: https://git.eclipse.org/r/46700
Comment 8 Olivier Prouvost CLA 2015-04-28 12:25:32 EDT
To solve it, I had to add a 'packageName' in the last page. This package name is used to produce the new activator class. Unfortunately in the existing code an old version of Activator is automatically generated (with extends AbstractUIPlugin). In the default behavior of this wizard, the new activator overrides the default generated one, but if the package of activator has changed, it can produce some problems. 

So this patch fixes the bug if the activator package name does not change... 

May be this could be solved in another bug because the template management is
not really easy to use when there are some following pages after the
activator page. 

If you keep the activator as it is, and change (or not) the last
packageName value it works fine.
Comment 9 Lars Vogel CLA 2015-05-04 13:30:26 EDT
*** Bug 466269 has been marked as a duplicate of this bug. ***
Comment 10 Lars Vogel CLA 2015-05-04 13:32:03 EDT
According to the end game rules I need another committer to approve this.
Comment 11 Lars Vogel CLA 2015-05-06 02:04:57 EDT
(In reply to Lars Vogel from comment #10)
> According to the end game rules I need another committer to approve this.

I test this change tonight and if successful will ask Vikas for additional +1.
Comment 13 Lars Vogel CLA 2015-05-06 15:59:37 EDT
Thanks Olivier, looks fine. As you said, it is still possible to create a syntax error by renaming the Activator package, please open a new bug for that.
Comment 14 Olivier Prouvost CLA 2015-05-07 03:21:29 EDT
I opened the bug #466680
Comment 15 Vikas Chandra CLA 2015-05-14 07:08:26 EDT
Lars/Olivier

Can you please verify this defect?
Comment 16 Lars Vogel CLA 2015-05-15 03:52:18 EDT
Verified in 4.5.0.I20150514-2000
Comment 17 Noopur Gupta CLA 2015-05-19 08:09:13 EDT
I can still reproduce the duplicate bug 466269 in I20150514-1000 and I20150517-2000.
Comment 18 Dani Megert CLA 2015-05-19 09:06:43 EDT
Olivier, any chance you can provide a fix until tomorrow?
Comment 19 Olivier Prouvost CLA 2015-05-19 09:33:08 EDT
Hi Dani, 
I can try to fix it for tomorrow afternoon. Would it be ok for you ?
Comment 20 Dani Megert CLA 2015-05-19 09:36:53 EDT
(In reply to Olivier Prouvost from comment #19)
> Hi Dani, 
> I can try to fix it for tomorrow afternoon. Would it be ok for you ?

Yes.
Comment 21 Olivier Prouvost CLA 2015-05-19 11:53:04 EDT
This bug is fixed for me. Noopur could you test it again? You mentioned an error but did you use the latest version ? 

To be sure, I tested it with 6 different parameters : 

For each test :  Contribution to UI : TRUE and Rich Client Platform YES

and then these variations :  

         Activator      Sample Content     LifeCycle      Result
Test1 :   Yes               No               No          No Error
Test2 :   Yes              Yes               No          No Error
Test3 :   Yes              Yes              Yes          No Error
Test4 :    No               No               No          No Error
Test5 :    No              Yes               No          No Error
Test6 :    No              Yes              Yes          No Error

I got no error for any project. 

The only case that can produce an error is when you change the package name of the activator. It has been explained in the bug #466680 and in comment #8 of this bug. 

Apparently the bug #466680 has been closed too early and I propose to reopen it and to close this one.  Are you ok ?  



So I propose to close this bug and to open a new one for the specific case of Activator rename.
Comment 22 Noopur Gupta CLA 2015-05-19 13:47:09 EDT
I used the RC1 build and I20150517-2000. I could reproduce it in both with the steps given in bug 466269 comment #0.

Note the step: 
- Select "Eclipse 4 RCP application" and click Finish.

In the Templates page, select "Eclipse 4 RCP application" and click *Finish*, not *Next and then Finish*.
Comment 23 Olivier Prouvost CLA 2015-05-20 03:21:07 EDT
Dani, I committed a patch (https://git.eclipse.org/r/48238) in bug #466680 that will fix these 2 bugs.
Comment 24 Noopur Gupta CLA 2015-05-20 06:43:33 EDT
(In reply to Olivier Prouvost from comment #23)
> Dani, I committed a patch (https://git.eclipse.org/r/48238) in bug #466680
> that will fix these 2 bugs.

The given patch will fix the 2 issues mentioned here. Hence, closing this bug.