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 98570 - property event not sent when doc is well-formed
Summary: property event not sent when doc is well-formed
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 98171 98413
  Show dependency tree
 
Reported: 2007-03-21 23:00 UTC by Joelle Lam
Modified: 2007-03-28 09:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NullPointerException (1.33 KB, text/html)
2007-03-23 01:43 UTC, Joelle Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joelle Lam 2007-03-21 23:00:07 UTC
Once a not well form document is loaded into the model, the model does not
trigger a property even when it is no well formed again.  Therefore, listeners
on the model do not know to update their views.
Comment 1 Joelle Lam 2007-03-21 23:01:11 UTC
Checking in SyncUpdateTest.java;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/SyncUpdateTest.java,v
 <--  SyncUpdateTest.java
initial revision: 1.1
done
IDE: [3/21/07 11:44 AM] Committing "model" finished
Comment 2 Petr Pisl 2007-03-22 11:11:17 UTC
The test was wrong. There were these steps:

model = loadRegistryModel( wellformedfile )
setDocumentContentTo( model, notwelformedfile)
model. addListener()
model = loadRegistryModel(wellformedfile)

The problem is that loadRegistryModel returns completely new model. So the
listener listens on different model. The last line has to be changed to
setDocumentContentTo( model, notwelformedfile). So the steps are:

model = loadRegistryModel( wellformedfile )
setDocumentContentTo( model, notwelformedfile)
model. addListener()
setDocumentContentTo( model, welformedfile)

In this case the property change is fired and test passes -> marking as invalid. 
Comment 3 Petr Pisl 2007-03-22 11:12:11 UTC
The fix of the test
Checking in SyncUpdateTest.java;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/SyncUpdateTest.java,v
 <--  SyncUpdateTest.java
new revision: 1.4; previous revision: 1.3
done
Comment 4 Joelle Lam 2007-03-23 01:36:09 UTC
Apologies, you are right, my test case was wrong.  I am trying to reproduce a
bug which I am running into in navigation.  Often, when I modify the xml to a
malformed file and then make it well-formed again, an event doesn't get
triggered.  I will try to reproduce a better unit test.
Comment 5 Joelle Lam 2007-03-23 01:40:25 UTC
IDE:-------------------------------------------------
IDE: [3/22/07 5:37 PM] Committing "model" started
cvs server: scheduling file `faces-config-wellformed.xml' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in faces-config-05.xml;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/faces-config-05.xml,v
 <--  faces-config-05.xml
new revision: 1.2; previous revision: 1.1
done
Checking in faces-config-notwellformed.xml;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/faces-config-notwellformed.xml,v
 <--  faces-config-notwellformed.xml
new revision: 1.2; previous revision: 1.1
done
Checking in SyncUpdateTest.java;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/SyncUpdateTest.java,v
 <--  SyncUpdateTest.java
new revision: 1.5; previous revision: 1.4
done
RCS file:
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/faces-config-wellformed.xml,v
done
Checking in faces-config-wellformed.xml;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/faces-config-wellformed.xml,v
 <--  faces-config-wellformed.xml
initial revision: 1.1
done
IDE: [3/22/07 5:37 PM] Committing "model" finished
Comment 6 Joelle Lam 2007-03-23 01:42:09 UTC
Here are the commits for the update test case.  It seems that a
NullPointerException is getting thrown in xam.  

Ultimately, this cauase AbstractModel line 240 to get called:
> endTransaction(true); // do not fire events

I will also attach the NullPointerException.
Comment 7 Joelle Lam 2007-03-23 01:43:03 UTC
Created attachment 39852 [details]
NullPointerException
Comment 8 Petr Pisl 2007-03-23 13:30:24 UTC
This is problem in my implementation. I will fix it. Thanks for finding this and
writing the test. 
Comment 9 Petr Pisl 2007-03-27 12:56:05 UTC
Adding implementation of ComponentUpdater, which solves the probelm. 

RCS file:
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/SyncUpdateVisitor.java,v
done
Checking in src/org/netbeans/modules/web/jsf/impl/facesmodel/SyncUpdateVisitor.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/SyncUpdateVisitor.java,v
 <--  SyncUpdateVisitor.java
initial revision: 1.1
done
Checking in
src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java,v
 <--  JSFConfigModelImpl.java
new revision: 1.4; previous revision: 1.3
done
Checking in
test/unit/src/org/netbeans/modules/web/jsf/xdm/model/SyncUpdateTest.java;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/SyncUpdateTest.java,v
 <--  SyncUpdateTest.java
new revision: 1.6; previous revision: 1.5
done
Comment 10 Petr Blaha 2007-03-28 09:27:22 UTC
The issue is considered as NB 6.0 M8 stopper since it's serious bug for VWP
functionality. The exceptions are thrown when faces-config.xml is modified.
Petre, please merge the fix in M8 branch
Comment 11 Petr Pisl 2007-03-28 09:47:53 UTC
Committed to the netbeans60-m8 branch. 

Checking in SyncUpdateVisitor.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/SyncUpdateVisitor.java,v
 <--  SyncUpdateVisitor.java
new revision: 1.1.2.1; previous revision: 1.1
done
Checking in JSFConfigModelImpl.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java,v
 <--  JSFConfigModelImpl.java
new revision: 1.3.2.1; previous revision: 1.3
done
Comment 12 Petr Pisl 2007-03-28 09:49:49 UTC
I'm sorry, the branch was release60-m8.