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

Bug 320370

Summary: Moving a JavaScript function in the HTML Outline View causes a null pointer exception.
Product: [WebTools] WTP Source Editing Reporter: Johannes Schade <jschade>
Component: wst.sseAssignee: Rakesh <rakes123>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: ccc, cmjaun, nsand.dev, rakes123
Version: 3.2Flags: nsand.dev: review+
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch nsand.dev: iplog+

Description Johannes Schade CLA 2010-07-20 06:02:41 EDT
Build Identifier: 20100617-1415

The Outline accompanying the JSP Editor displays the functions inside the SCRIPT HTML element. When trying to move a function the insertion line appears as it does on the Outline of the Java EDitor but when the function is dropped an error message pop up reading "An error has occurred. See error log for more details. java.lang.NullPointerException".
I have tried this with several document types and seems to occur with any of them.

Reproducible: Always

Steps to Reproduce:
1.Select the WebContent node in the Project Explorer.
2.Right-click to display the context menu.
3.On the context menu select New. This displays a submenu.
4. On the submenu select HTML File. This displays the New HTML File dialogue.
5. On the dialogue enter a file name.
6. Click Finish. This opens an editor with the automatically created HTML file stub and a corresponding Outline View.
7. Add a SCRIPT HTML element inside the HEAD element.
8. Enter two JavaScript functions inside the SCRIPT element. Provide some content such as an alert statement.
9. Save the file and close the editor (otherwise the script element on nthe Outline does not show the functions).
10 Open the editor again.
11. On the Outline extend the HTML node, then the HEAD node and finally the SCRIPT node to show the nodes representing the two functions.
12. Select the first function and try to move it under the second function. The line indicating the insertion position appears but you will get a null pointer error when releasing the mous button.
Comment 1 Rakesh CLA 2010-07-22 11:36:26 EDT
Created attachment 174993 [details]
patch

I have added a null pointer check.But it will not move functions, this functionality is not supported yet.
Comment 2 Nick Sandonato CLA 2010-08-24 16:49:34 EDT
Looks good.