Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361589

Summary: Java gen - Record should be value type, functions returns a record should make a copy
Product: z_Archived Reporter: Jing Qian <jqian>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P1 CC: carrollk, greer, jeffdouglas, jvincens, mayunf, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
lib1
none
libTest none

Description Jing Qian CLA 2011-10-20 16:20:54 EDT
I have attached 2 libraries.

Either use EUnit to generate egl test driver for java for libTest

or write a program that invokes libTest

you can test2 fails


	function test2() {@Test}
		lib1.init();
		lib1.getJRecord().f1 = "abcd";
		syslib.writeStdOut("test2 expecting xyz");
		lib1.printRecord();
		LogResult.assertStringEqual1("xyz", lib1.getField1());		
	end

According to Tim W,
lib1.getJRecord should return a internal temp variable which is a copy of the record, just like test1
Comment 1 Jing Qian CLA 2011-10-20 16:21:50 EDT
Created attachment 205675 [details]
lib1
Comment 2 Jing Qian CLA 2011-10-20 16:22:03 EDT
Created attachment 205676 [details]
libTest
Comment 3 Jing Qian CLA 2011-10-20 16:30:31 EDT
javascript gen fails test1 and test2, see Bug 361590
Comment 4 Jeff Douglas CLA 2011-10-28 05:03:14 EDT
I'm going to talk with Tim on this, because what you are saying doesn't make any sense to me. If the getRecord method was implemented so that it always made a copy, then the user would not be able to change anything in the record, except by the direct approach of x.r.??? =
Comment 5 Jeff Douglas CLA 2011-11-01 08:52:57 EDT
fixed
Comment 6 Jing Qian CLA 2011-11-11 15:31:40 EST
verified java is fixed in 2011/11/11/0901's build

However, javascript still have 2 failures out of 3
the following is javascript results

libTest::test1: FAILED - Failed: Expected value = 'xyz' Actual value = 'abc' 
libTest::test2: FAILED - Failed: Expected value = 'xyz' Actual value = 'abcd' 
libTest::test3: OK

reopen it against javascript gen
Comment 7 Jing Qian CLA 2011-11-11 15:32:28 EST
please also check Bug#361855, might be a duplicate?
Comment 8 Yun Feng Ma CLA 2011-11-13 22:22:43 EST
For JSGen part, this is duplicated with bug 361590.

*** This bug has been marked as a duplicate of bug 361590 ***
Comment 9 Lisa Lasher CLA 2012-01-13 14:26:34 EST
closing defect