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

Bug 329065

Summary: No need to check for CNature or CCNature in PathEntryManager.getRawPathEntries()
Product: [Tools] CDT Reporter: Santosh Mising name <santoshbmath>
Component: cdt-coreAssignee: Project Inbox <cdt-core-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Santosh Mising name CLA 2010-10-29 12:55:28 EDT
Build Identifier: I20100608-0911

In PathEntryManager.getRawPathEntries() initially project nature is checked i.e. cnature or ccnature. If project does not have any of these nature then Exception is thrown. 

I feel this checking is not required. The reason being, if we remove the cnature using CProjectNature.removeCNature() then cnature is removed from the project first then while setting project description back, it will goto getRawPathEntries() and throws Exception (since cnature is removed already).

Reproducible: Always
Comment 1 Andrew Gvozdev CLA 2010-10-29 13:19:38 EDT
Can you give some context for this bug report? What user action triggers the exception? Can you attach the stack trace from .log?
Comment 2 Santosh Mising name CLA 2010-10-30 11:33:54 EDT
(In reply to comment #1)
> Can you give some context for this bug report? What user action triggers the
> exception? Can you attach the stack trace from .log?

This is triggered when you call CProjectNature.removeCNature() to remove the cnature for the project.

I am working on a product which extends CDT, in that i will add cnature to the project and sometimes it's required to remove the cnature from the project. So when i call removeCNature(), i get exception "Project does not contain valid configurations"

The reason for exception is, in removeCNature(), cnature is removed from the project description first then setDescription() is called to set the new project description. But by this time, cnature will be remvoed from project. So when it comes to PathEntryManager.getRawPathEntries(), it checks for cnature and since its removed, it will throw CModelException.
Comment 3 Santosh Mising name CLA 2010-12-16 13:00:13 EST
(In reply to comment #1)
> Can you give some context for this bug report? What user action triggers the
> exception? Can you attach the stack trace from .log?

What's the status on this? Need more information?