Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332806 - FacetedProjectWizard class bug
Summary: FacetedProjectWizard class bug
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 20:17 EST by Lee Wang-soo CLA
Modified: 2011-01-05 15:03 EST (History)
1 user (show)

See Also:


Attachments
patch for fixing 33286 bug (1.46 KB, patch)
2010-12-17 19:47 EST, Lee Wang-soo CLA
konstantin: iplog+
Details | Diff
simple plugin project for test patch (5.71 KB, application/x-zip-compressed)
2010-12-17 19:51 EST, Lee Wang-soo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Wang-soo CLA 2010-12-16 20:17:32 EST
Build Identifier: M20100909-0800

I've created new wizard by extending
org.eclipse.wst.common.project.facet.ui.FacetedProjectWizard.
When my new wizard does finish, error 'Invalid project description' occurred and project creations fails.
I look the code in FactedProjectWizard, and found the code cause error:
 @Override
    public IWizardPage getNextPage( final IWizardPage page )    {
        if( page == this.firstPage )        {
            final IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
            fpjwc.setProjectName( this.firstPage.getProjectName() );
            fpjwc.setProjectLocation( this.firstPage.getLocationPath() );
        }
        return super.getNextPage( page );
    }

last line: 

  fpjwc.setProjectLocation( this.firstPage.getLocationPath() ); 

should be modified to

  IPath locationPath = null;
  if (firstPage.useDefaults()) {
    locationPath = this.firstPage.getLocationPath();
  }
  fpjwc.setProjectLocation(locationPath);

When using default project location (workspace location), locationPath should be null.


Reproducible: Always
Comment 1 Lee Wang-soo CLA 2010-12-16 20:49:59 EST
(In reply to comment #0)

There is mistake. Above modified code should be as following:

  IPath locationPath = null;
  if (!firstPage.useDefaults()) { // when not using default location
    locationPath = this.firstPage.getLocationPath();
  }
  fpjwc.setProjectLocation(locationPath);

When using default project location (workspace location), locationPath should
be null.
Comment 2 Carl Anderson CLA 2010-12-17 11:38:26 EST
Lee, are you able to create a patch for this? Attaching a proposed patch helps more than simply putting the code change into a bug comment.
Comment 3 Lee Wang-soo CLA 2010-12-17 19:47:53 EST
Created attachment 185469 [details]
patch for fixing 33286 bug
Comment 4 Lee Wang-soo CLA 2010-12-17 19:51:22 EST
Created attachment 185470 [details]
simple plugin project for test patch

You can test patch by run "Extends FPWizard" New Project Wizard in others category.
Comment 5 Konstantin Komissarchik CLA 2011-01-05 15:02:30 EST
Comment on attachment 185469 [details]
patch for fixing 33286 bug

Thanks for the patch and the test plugin.
Comment 6 Konstantin Komissarchik CLA 2011-01-05 15:03:13 EST
Released fix to 3.2.3, 3.3.0 and fproj branch.