Bug 65116 - IProjectDescription.getBuildSpec copies commands
Summary: IProjectDescription.getBuildSpec copies commands
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-01 15:06 EDT by John Arthorne CLA
Modified: 2004-06-11 10:30 EDT (History)
0 users

See Also:


Attachments
Proposed patch (2.78 KB, patch)
2004-06-03 06:37 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2004-06-01 15:06:14 EDT
Build: 3.0 RC1

The method JavaProject.setJavaCommand calls IProjectDescription.getBuildSpec
twice, and assumes that identical build command instances will be returned. This
is no longer true. We had to change this in 3.0 because ICommand instances are
not immutable, and changes made the command arguments were previously not
triggering a proper resource delta. I recomend either only calling gteBuildSpec
once, or use equality rather than identity when comparing commands:

if (oldCommands[i].equals(oldJavaCommand)) {
	oldCommands[i] = newCommand;
	break;
}

See bug 64128 for background info.
Comment 1 Jerome Lanneluc CLA 2004-06-03 06:37:08 EDT
Created attachment 11529 [details]
Proposed patch

Changed getJavaCommand(...) to take the build spec as an argument and to return
the index of the Java command.
Comment 2 John Arthorne CLA 2004-06-03 10:45:56 EDT
Fix looks fine to me.
Comment 3 Jerome Lanneluc CLA 2004-06-07 13:22:24 EDT
Released patch.
Comment 4 Olivier Thomann CLA 2004-06-11 10:30:12 EDT
Verified in 200406110010