This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 101887 - Rename page from Project view throws NPE
Summary: Rename page from Project view throws NPE
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Joelle Lam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-20 01:53 UTC by Joanne Lau
Modified: 2007-07-03 17:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
attached logfile (4.67 KB, text/plain)
2007-04-20 01:54 UTC, Joanne Lau
Details
exception log attached (6.36 KB, text/plain)
2007-04-24 19:43 UTC, Joanne Lau
Details
Exception logged (in Preview M9 build) (7.51 KB, text/plain)
2007-04-27 19:45 UTC, Joanne Lau
Details
PFE after page renamed (55.27 KB, image/gif)
2007-04-27 23:55 UTC, Joanne Lau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joanne Lau 2007-04-20 01:53:15 UTC
NB 0704171800
VW 070419_1

- Create 2 VW pages Page1 & Page2
- Add a button on each page
- Have a couple JSP pages J1, J2
- Create links from Page1-> Page2 and vice versa
  Create links from J1 -> J2, J2->J1
- From Projects view,  renaming Page2 throws NPE exception 

SEVERE [global]
java.lang.NullPointerException
        at com.sun.tools.javac.api.JavacTrees.getTree(JavacTrees.java:128)
        at com.sun.tools.javac.api.JavacTrees.getTree(JavacTrees.java:123)
        at com.sun.tools.javac.api.JavacTrees.getTree(JavacTrees.java:63)
        at
org.netbeans.modules.visualweb.insync.java.EventMethod$3.run(EventMethod.java:81)
        at
org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:51)
        at
org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:34)
        at
org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:459)
        at
org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.execute(ReadTaskWrapper.java:58)
        at
org.netbeans.modules.visualweb.insync.java.EventMethod.getMethodReturn(EventMethod.java:78)
        at
org.netbeans.modules.visualweb.insync.live.BeansDesignEvent.getHandlerMethodReturn(BeansDesignEvent.java:182)
        at
org.netbeans.modules.visualweb.navigation.VWPContentModel.updatePageContentItems(VWPContentModel.java:246)
        at
org.netbeans.modules.visualweb.navigation.VWPContentModel.<init>(VWPContentModel.java:61)
        at
org.netbeans.modules.visualweb.navigation.VWPContentModelProvider.getPageContentModel(VWPContentModelProvider.java:36)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowNode.updateContentModel(PageFlowNode.java:76)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowNode.<init>(PageFlowNode.java:62)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowController.createPageFlowNode(PageFlowController.java:380)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowController.createAllProjectPageNodes(PageFlowController.java:394)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowController.setupGraph(PageFlowController.java:323)
        at
org.netbeans.modules.web.jsf.navigation.FacesModelPropertyChangeListener$5.run(FacesModelPropertyChangeListener.java:161)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
[catch] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
        at java.awt.Dialog$1.run(Dialog.java:1039)
        at java.awt.Dialog$3.run(Dialog.java:1091)
        at java.security.AccessController.doPrivileged(Native Method)
 ......


  (Please see attachement for entire log)
Comment 1 Joanne Lau 2007-04-20 01:54:23 UTC
Created attachment 41302 [details]
attached logfile
Comment 2 _ sandipchitale 2007-04-20 02:07:34 UTC
Joelle, please look at it first. If it is Insync issue assign it to Deva.
Comment 3 Joelle Lam 2007-04-21 05:23:36 UTC
This should have been fixed with todays commit. 
User: JoelleLam
Date: 2007/04/20 14:12:23

Modified:
   web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowNode.java
  
web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/FacesModelPropertyChangeListener.java
  
web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/WebFolderListener.java
  
web/jsf/navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowController.java

Log:
 Refactoring fix.
Comment 4 Joanne Lau 2007-04-24 19:42:28 UTC
With NB 070424

Simpler scenario:
- Rename a page that has navigation rule from the Projects Window
  throws the same exception 
  (see attached log)
Comment 5 Joanne Lau 2007-04-24 19:43:16 UTC
Created attachment 41574 [details]
exception log attached
Comment 6 Joanne Lau 2007-04-24 19:47:45 UTC
As the result, the page didn't get renamed in the pageflow editor, but there 
is an orange dot displayed to the page.  
Close and reopen faces-config.xml,  a new additional page was created in the 
editor (with the renamed name).  This is incorrect. 
Comment 7 Joanne Lau 2007-04-27 19:41:34 UTC
NB Preview M9 version:

Getting NPE exception:

SEVERE [global]
java.lang.NullPointerException
        at
org.netbeans.modules.visualweb.insync.java.EventMethod$3.run(EventMethod.java:93)
        at
org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:51)
        at
org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:34)
        at
org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:475)
        at
org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.execute(ReadTaskWrapper.java:58)
        at
org.netbeans.modules.visualweb.insync.java.EventMethod.getMethodReturn(EventMethod.java:90)
        at
org.netbeans.modules.visualweb.insync.live.BeansDesignEvent.getHandlerMethodReturn(BeansDesignEvent.java:182)
        at
org.netbeans.modules.visualweb.navigation.VWPContentModel.updatePageContentItems(VWPContentModel.java:257)
        at
org.netbeans.modules.visualweb.navigation.VWPContentModel.<init>(VWPContentModel.java:62)
        at
org.netbeans.modules.visualweb.navigation.VWPContentModelProvider.getPageContentModel(VWPContentModelProvider.java:36)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowNode.updateContentModel(PageFlowNode.java:76)
        at
org.netbeans.modules.web.jsf.navigation.PageFlowNode.<init>(PageFlowNode.java:62)


(see attachment for entire stack trace)
Comment 8 Joanne Lau 2007-04-27 19:45:08 UTC
Created attachment 41877 [details]
Exception logged (in Preview M9 build)
Comment 9 Joanne Lau 2007-04-27 22:38:29 UTC
Raising to P1 after discussing with Joelle.
Comment 10 Joanne Lau 2007-04-27 23:54:43 UTC
- Close face-config.xml before page rename
- Rename page via Projects view
- Open faces-config.xml, the page didn't get rename, but another page icon
  (with the renamed name) is created
  (see rename_page.gif)
Comment 11 Joanne Lau 2007-04-27 23:55:37 UTC
Created attachment 41903 [details]
PFE after page renamed
Comment 12 Joelle Lam 2007-04-28 00:30:32 UTC
There are two issues with this bug:

1) When refactoring the case/rule of the faces-config is not updated.   This is
most visible when you look at the xml file and ignore any of the Page Flow UI.

2) The second issue is that after I reset the node, I don't re-ask Insync if
there are any new PageContentItems.  This is probably the source of NPE.

Sandip, will you evaluate #1.  I am going to open a separate bug for #2.
Comment 13 Joelle Lam 2007-04-28 01:57:11 UTC
Created new bug for #2 portion mentioned below.  102855

The "believe" the cause of this bug is because I do not request a model for the
new node when it is reset.   Research continues.  

Assigning back to me.
Comment 14 Joelle Lam 2007-04-30 17:11:06 UTC
These comments are a follow up of a series of emails.  Because QE is confused
over the bugs I am updating this workaround in the bug description directly.  

ONLY Side affect of NPE bug: You see child elements in a non bacedk jsp page.

Work around: Refresh by opening or closing or switching views will make the
child elements (ie buttons) show appropriately in the right page.

Although there is an NPE: there is no side affect to the data.  The navigation
data is correct displayed on the page. 

Just to reiterate past comments - Two bugs (actually three) were filed under one.
1) The bug described above.  This is the source of the NPE you filed on Friday
the 27th and causes buttons to show up in the old named node.  
2) If you review the faces-config file you will find that when you did a rename,
the faces-config was not updated.  So this is a newly introduce refactoring
bug.(102855)
3) And in fact, there is a third bug that was fixed on the 20th.  Look at the
NPE stack and you will see that they are different. 

#2 is the only regression (which probably happened on the 24th) but has a very
easy workaround that is easy for the user to figure out (Please look at 102855
as I specified the workaround in the first comment of the bug). 

But #1 is not a regression.  This piece has never worked in that because #2 is
broken it is has brought to light a scenario that has not been tested.  This
scenario is to rename a VWP page with child components without refactoring.  So
according to the bug priorities, this bug is not a P1.
http://qa.netbeans.org/bugzilla/bug_priority_guidelines.html

So I am asking again to have QE re-evaluate the priority on this bug.  Is THIS
BUG (not 102855) a P1 in that the product should not be shipped until this bug
is fixed?  If you are still unsure, you may want to ask someone else in QE. 
Either Sandeep or Krys.  You can also call me.
Comment 15 Joanne Lau 2007-04-30 17:23:55 UTC
Using the latest M9 build 0704300000 and retry the test. Closing and reopening
the faces-config.xml, the page displayed correctly in PFE, and I'm able to navigate
from page1 to page2 during deployment time. I'm downgrading it to P2. 
Comment 16 Joelle Lam 2007-06-27 00:22:01 UTC
I believe this was fixed at an earlier date.
Comment 17 Joanne Lau 2007-07-03 17:40:10 UTC
Verified in M10 Build 200706281431