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

Bug 362507

Summary: NullPointerException on Plus and Concat in EList
Product: z_Archived Reporter: broy2
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P1 CC: hjiyong, pfyu, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix lasher: iplog+

Description broy2 CLA 2011-10-31 12:15:10 EDT
NPE on newList = myNames + element; 

program plusProb type BasicProgram {}
    myNames string[] =["Carolina", "State", "Duke"];
    element string = "Meredith";
    newList string[];
    function main()
        newList = myNames + element;  
    end
end

Multiple markers at this line
IWN.JavascriptGen.9998.e 8/188 Exception occurred: java.lang.NullPointerException
IWN.JavascriptGen.9999.e 8/188 Stack Trace: java.lang.NullPointerException
Comment 1 Brian Svihovec CLA 2011-10-31 23:18:11 EDT
Does this testcase fail when generating Java as well?  If not, this should probably go to the JS Gen component.
Comment 2 Paul Harmon CLA 2011-11-02 09:24:20 EDT
I am routing this to JSGen, since this is working in JavaGen.

The "+" operator to concatenate elements to a list is being removed (will give errors in validation). The only valid operator for concatenation to an array is "::", and the only valid concatenation assignment is "::="
Comment 3 broy2 CLA 2011-11-02 09:52:48 EDT
OK, changed the program to use ::.
Still have errors in the editor which prevent testing in Java and JS. 

program plusProb type BasicProgram {}
    myNames string[] =["Carolina", "State", "Duke"];
    element string = "Meredith";
    newList string[];
    function main()
        newList = myNames :: element;  
    end
end

IWN.JavascriptGen.9998.e 8/188 Exception occurred: java.lang.NullPointerException	
IWN.JavascriptGen.9999.e 8/188 Stack Trace: java.lang.NullPointerException
Comment 4 Huang Ji Yong CLA 2011-11-03 01:46:13 EDT
*** Bug 362629 has been marked as a duplicate of this bug. ***
Comment 5 Huang Ji Yong CLA 2011-11-03 02:16:24 EDT
Created attachment 206380 [details]
fix
Comment 6 Huang Ji Yong CLA 2011-11-03 02:19:13 EDT
This is a regression of bug 362155.
Widget qualifier has to be handled differently.
Comment 7 broy2 CLA 2011-11-03 11:19:43 EDT
Verified in 20111103 build.