Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329065 - No need to check for CNature or CCNature in PathEntryManager.getRawPathEntries()
Summary: No need to check for CNature or CCNature in PathEntryManager.getRawPathEntries()
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 12:55 EDT by Santosh Mising name CLA
Modified: 2020-09-04 15:27 EDT (History)
0 users

See Also:


Attachments

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