Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360058 - NPE in NewClassCodeGenerator when attempting to create files not under a source root
Summary: NPE in NewClassCodeGenerator when attempting to create files not under a sour...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.0.2   Edit
Assignee: Sergey Prigogin CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 21:27 EDT by Sergey Prigogin CLA
Modified: 2011-10-06 21:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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