Bug 152714 - API: IJavaProject.setRawClasspath with validate edit context
Summary: API: IJavaProject.setRawClasspath with validate edit context
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 141451
  Show dependency tree
 
Reported: 2006-08-03 05:12 EDT by Martin Aeschlimann CLA
Modified: 2011-03-29 09:08 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 Martin Aeschlimann CLA 2006-08-03 05:12:27 EDT
3.2

When IJavaProject.setRawClasspath modifies the .classpath file it calls validateEdit before the modification. As it has no context it passes 'null' as context.

Unfortunatly validateEdit is not very useful to the user without context. The user expects to be prompted when a file is checked-out, but won't if context is null. (see for example bug 141451). IMO it should be avoided to call validateEdit with null.

I see no other solution than adding new API on setRawClasspath that also takes a context. I agree that this looks ugly.
The alternative is that jdt.ui changes it's calls to setRawClasspath to first call validateEdit on .classpath. In theory, jdt.ui doesn't know that the file is called .classpath.
We have ~20 references to setRawClasspath so we would introduce a utility that replaces setRawClasspath and adds an additional validate edit first.

API suggestion:

IStatus setRawClasspath(IClasspathEntry[] entries, IPath outputLocation, Object validateEditContext, IProgressMonitor monitor)
Comment 1 Philipe Mulet CLA 2008-11-04 08:43:29 EST
Is this still needed ?