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

Bug 360058

Summary: NPE in NewClassCodeGenerator when attempting to create files not under a source root
Product: [Tools] CDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: cdt-editorAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0.2   
Hardware: All   
OS: All   
Whiteboard:

Description Sergey Prigogin CLA 2011-10-05 21:27:32 EDT
To reproduce try to create a class not under a source root. Such an attempt results in NPE:

java.lang.NullPointerException
      at
org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:
208)
      at
org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:
2107)
      at
org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:
2047)
      at
org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:
60)
      at org.eclipse.cdt.internal.ui.wizards.NewElementWizard
Comment 1 Sergey Prigogin CLA 2011-10-06 20:39:55 EDT
Fixed in cdt_8_0 and master.
Comment 2 CDT Genie CLA 2011-10-06 21:23:07 EDT
*** cdt git genie on behalf of Sergey Prigogin ***

    Bug 360058 - NPE in NewClassCodeGenerator when attempting to create
    files not under a source root. Eliminated faulty canonicalization
    if resource paths.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=5c8b7da9f42ee80f48537cf2037c15e59bf2d83a
Comment 3 CDT Genie CLA 2011-10-06 21:23:08 EDT
*** cdt git genie on behalf of Sergey Prigogin ***

    Bug 360058 - NPE in NewClassCodeGenerator when attempting to create
    files not under a source root. Eliminated faulty canonicalization
    if resource paths.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=70d8eade30faa22f1c976f3459872a5be4fe3bbf