Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357274 - Delegate comparisons result in InvocationTargetExceptions
Summary: Delegate comparisons result in InvocationTargetExceptions
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: Yun Feng Ma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-09 14:48 EDT by Scott Greer CLA
Modified: 2017-02-23 14:15 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 Scott Greer CLA 2011-09-09 14:48:07 EDT
From the FVT testcases:

	function testMatch(e Event in)
		type1 Del1 = foo;
		type2 Del2 = foo2;
		type3 Del2 = foo2;

		variation = "Compare type1 == foo";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type1 == foo),true) );
		
		variation = "Compare type1 != foo";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type1 != foo),false) );
		
		variation = "Compare type2 == foo2";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type2 == foo2),true) );
		
		variation = "Compare type2 == foo3";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type2 == foo3),false) );
		
		variation = "Compare type2 != foo3"; 
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type2 != foo3),true) );
		 
		variation = "Compare foo3 == foo3";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((foo3 == foo3),true) );
		
		variation = "Compare type2(foo2) == type3(foo2)";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type2 == type3),true) );

		type3 = foo3;		
		variation = "Compare type2(foo2) == type3(foo3)";
		TestUILib.reportStatus(jsLib.getFile(), jsLib.getLine(), compareBoolean((type2 != type3),true) );
	end
Comment 1 Paul Harmon CLA 2011-10-26 10:57:10 EDT
This is working in the mof model now. However, after simplifying the testcase to:

delegate del1() end
delegate del2() end

library lib3 

	bool boolean;
	function foo()
	end
	

    function testMatch(e Event in)
        type1 Del1 = foo;
 
		bool = type1 == foo;
		bool = type1 != foo;

     end
  end


I get compile errors in the generated Java. I am routing this to JavaGen to look at this.
Comment 2 Paul Harmon CLA 2011-10-26 10:59:32 EDT
Additionally, please route this to JSGen when the java is working correctly. I ran the following test in JS and the output is:
false
true

I expect the output to be
true
false


delegate del1() end


handler Hand2 type RUIhandler{initialUI =[ui
            ], onConstructionFunction = start, cssFile = "css/proj1.css", title = "Hand2"}

    ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[]};


	function foo()
	end
	
    function start()
        type1 Del1 = foo;

		SysLib.writeStdout(type1 == foo);
		SysLib.writeStdout(type1 != foo);

     end
    
end
Comment 3 Jeff Douglas CLA 2011-11-10 13:27:21 EST
I've fixed this, however Paul needs to fix the compiler problem for "foo == foo"

Sending this over to JSGen as requested
Comment 4 Yun Feng Ma CLA 2011-11-13 07:04:43 EST
Fixed JSGen part. Thanks.
Comment 5 Paul Harmon CLA 2011-11-18 11:36:58 EST
working great now