Bug 94404 - [model] Disallow classpath attributes with same key
Summary: [model] Disallow classpath attributes with same key
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 12:25 EDT by Martin Aeschlimann CLA
Modified: 2005-05-27 10: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 2005-05-10 12:25:22 EDT
20050509

The Javadoc of the factory methods for classpath entries should specify that
more than one classpath attributes with same key is disallowed.

See also bug 94163.
Comment 1 Philipe Mulet CLA 2005-05-10 15:24:15 EDT
We did not intend duplicates there, and should indeed prevent these to occur. 
Proposal is to spec this, and have classpath validation reject this scenario
(thus one cannot set such a classpath).

Could only be done for RC1 at best.

Jim - ok for this minor API tuning ?
Comment 2 Jim des Rivieres CLA 2005-05-10 15:26:54 EDT
approved for RC1
Comment 3 Frederic Fusier CLA 2005-05-25 10:33:13 EDT
Paragraph about extra attributes will be modified as follow for each javadoc
comment of JavaCore.new*Entry method:
 * <p>
 * The <code>extraAttributes</code> list contains name/value pairs that must be
persisted with
 * this entry. If no extra attributes are provided, an empty array must be
passed in.<br>
 * Note that this list should not contain any duplicate name.
 * </p>

Note that new message status will be displayed in case of duplicate extra
attribute while validating classpath entry in
ClasspathEntry.validateClasspathEntry(...)):
"Duplicate extra attribute: ''{0}'' in classpath entry ''{1}'' for project {2}"

Note also that, to minimize side effect (safe mode at this late stage of
dvpt...), this validation is done after all other validations already done in
this method. That means this message will only be visible in status if classpath
entry does not contain any other error...
Comment 4 Frederic Fusier CLA 2005-05-25 12:14:44 EDT
Fixed as described in previous comment and released in HEAD.

[jdt-core internal]
Changes done in JavaCore.new*Entry methods (javadoc comments),
ClasspathEntry.validateClasspathEntry(....) method and
org.eclipse.jdt.internal.core.util.Messages

Test case added in ClasspathTests
Comment 5 Olivier Thomann CLA 2005-05-27 10:08:48 EDT
Verified in I20050526-2000