| Summary: | ResourceException in org.eclipse.cdt.managedbuilder.internal.enablement.HasNatureExpression | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Samuel JUDITH <samuel> | ||||||
| Component: | cdt-build-managed | Assignee: | James Blackburn <jamesblackburn+eclipse> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Chris Recoskie <recoskie> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdtdoug, dpochet, jamesblackburn+eclipse | ||||||
| Version: | 4.0 | ||||||||
| Target Milestone: | 7.0.2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Samuel JUDITH
Created attachment 183408 [details]
the attachment is a patch
The ResourceException is raised because the project just has been removed. Before testing if the project has the wanted nature, a test is done to check if the project still exists.
Thanks for the patch. Wouldn't a better fix be to simply remove the logging of the exception at line 67? The only method that can throw a core exception is getDescription() which happens precisely for non-existence and non-accessibility. Also you say NPE in the description, and I see you've added a null check in the patch -- are you getting a NPE or just a CoreException logged? The backtrace you've provided just shows CoreException. You're right :I wanted to modify the description but maybe it's not possible. No NPE in fact: it's a mistake in my description. There's just a ResourceException which is a kind of CoreException. So the null check is surely useless since IResource.getProject() return null only when this resource is the workspace root (according to the IResource#getProject javadoc). (In reply to comment #3) > Also you say NPE in the description, and I see you've added a null check in the > patch -- are you getting a NPE or just a CoreException logged? The backtrace > you've provided just shows CoreException. Created attachment 183425 [details]
fix
Fix to be committed.
Fixed in HEAD and 7.0.2. Samuel, please verify that it fixes your issue. *** cdt cvs genie on behalf of jblackburn *** Bug 330594 - ResourceException checking HasNatureExpression when project closed [*] HasNatureExpression.java 1.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java?root=Tools_Project&r1=1.2&r2=1.3 [*] HasNatureExpression.java 1.2.18.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java?root=Tools_Project&r1=1.2&r2=1.2.18.1 |