Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360742 - Dictionary caseSensitive not working on first key
Summary: Dictionary caseSensitive not working on first key
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 18:46 EDT by broy2 CLA
Modified: 2017-02-23 14:16 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description broy2 CLA 2011-10-12 18:46:36 EDT
Debug the following:

program caseProblem 
  myDictionary Dictionary = new dictionary ( true, OrderingKind.byInsertion )
    {
      ID        = 5,
      lastName  = "Twain",
      firstName = "Mark"
    };
	myBoolean boolean;	   
	function main()
		myBoolean = myDictionary.containsKey("ID");
		SysLib.writeStdout("Should be true > " + myBoolean);
		myBoolean = myDictionary.containsKey("id");
		SysLib.writeStdout("Should be false > " + myBoolean);		
		myBoolean = myDictionary.containsKey("lastName");
		SysLib.writeStdout("Should be true > " + myBoolean);
		myBoolean = myDictionary.containsKey("lastname");
		SysLib.writeStdout("Should be false > " + myBoolean);		
	end	  
end

It looks like the caseSensitive true is not working on the first key ID but is working on lastName and firstName.

Looking at the variables view in debug:
myDictionary
  id                     <--  should be ID
  lastName
  firstName

EDT results:
Should be true > false
Should be false > true
Should be true > true
Should be false > false

RBD results as expected:
Should be true > true
Should be false > false
Should be true > true
Should be false > false







	/**
	 * Constructor used to set the value of case sensitivity and ordering
	 *
	 * @param caseSensitive  set if the dictionary is case sensitive
	 * @param ordering  set the order maintained in the dictionary.
	 */
	constructor(caseSensitive boolean in, ordering OrderingKind in);
Comment 1 Jeff Douglas CLA 2011-10-19 11:41:46 EDT
The problem is that the xml has altered the value of "ID" to "id", which causes the failures.
Comment 2 Paul Harmon CLA 2011-10-19 12:08:52 EDT
I have fixed this with a change to EGL2MofExpression
Comment 3 broy2 CLA 2011-10-20 14:17:38 EDT
Verified in 20111020 build.