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 179377

Summary: convert to composite component doesn't add namespace definition
Product: javaee Reporter: Jindrich Sedek <jsedek>
Component: JSF EditorAssignee: Vitezslav Stejskal <vstejskal>
Status: VERIFIED FIXED    
Severity: normal CC: mfukala, pjiricka, sustaining
Priority: P2 Keywords: REGRESSION
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Jindrich Sedek 2010-01-11 06:19:41 UTC
Create new Web Application with JSF 2.0 framework
select "Hello from Facelets" in index.xhtml and invoke convert to compomposite component
finish wizard
the original text is replaced with <ez:out>, but the ez namespace is not defined

NOTE: It works well in Maven web project - it seems to be related to ant projects
Comment 1 Marek Fukala 2010-01-11 06:37:39 UTC
reproducible, this used to work
Comment 2 Marek Fukala 2010-01-11 09:05:06 UTC
The issue happens only if there wasn't any composite component in the project when the project is created/opened. If there is at least one composite component when the project is opened, then the composite components support works fine.

The cause is caching and general behavior of QuerySupport instances. Currently I do hold the QS instances for both embedded and binary indexes during existence of the "jsf support" which more or less reflects the project livecycle.

The QuerySupport creates and caches the index instances for indexed roots when its instance is created, BUT an instance of an indexer is not created/obtained if there isn't any index document belonging to the indexing root. So if one gets an instance of QS when there wasn't any idexable source and then adds one or more, the results from them won't be visible in the index queries using the QS.

I'd discussed the problem with Vita and we agreed that he would fix it in the QuerySupport. A check for new index being available for one of the indexing roots will be added when one does a query on the QuerySupport instance.

Vito, I belive it is much easier for you if you simply add here a patch and I'll verify it a possibly integrate. To be able to reproduce you need to install a Glassfish application server and setup a web project which I recon you do not like :-). If I am mistaken, here are the steps:

1) create new web project with JavaEE6, add JSF framework
2) in the default index page select a piece of text (e.g. the Hello word!) invoke editor popup and choose Refactor -> Convert to composite component
3) in the panel just press finish
=> if the fix is correct, the shouldn't be any error in the opened xhtml file, if not there's a red squiggly line under the generated '<ez:out/>' code and error says 'undeclared component'

Thanks!
Comment 3 Vitezslav Stejskal 2010-01-12 01:31:56 UTC
http://hg.netbeans.org/jet-main/rev/64c2b34a8674

The testcase seem to pass with the above patch. Please verify.
Comment 4 Quality Engineering 2010-01-13 12:29:08 UTC
Integrated into 'main-golden', will be available in build *201001131418* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/64c2b34a8674
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #179377: check that indexed data exist for a root before each query; some clients keep an instance of QS for a long time and repeatedly perform queries on it
Comment 5 Jindrich Sedek 2010-01-14 03:03:15 UTC
NetBeans IDE Dev (Build 201001140201)
Comment 6 pgebauer 2010-01-18 09:23:56 UTC
The bugfix changes the source code introduced by issue 177464 bugfix ( http://hg.netbeans.org/main/rev/72b27a5dbaf8 ). Please, consider whether this is a good candidate for a patch. If so, could you please provide a changeset for the release68_fixes branch?
Comment 7 Vitezslav Stejskal 2010-01-18 09:36:19 UTC
(In reply to comment #6)
> The bugfix changes the source code introduced by issue 177464 bugfix (
> http://hg.netbeans.org/main/rev/72b27a5dbaf8 ). Please, consider whether this
> is a good candidate for a patch

This is not up to me to decide.
Comment 8 Marek Fukala 2010-01-18 09:39:38 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > The bugfix changes the source code introduced by issue 177464 bugfix (
> > http://hg.netbeans.org/main/rev/72b27a5dbaf8 ). Please, consider whether this
> > is a good candidate for a patch
> 
> This is not up to me to decide.
I would like to have the fix in the patch if possible. I belive Vita is the one who can really estimate the risk.
Comment 9 Vitezslav Stejskal 2010-01-18 09:59:45 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > The bugfix changes the source code introduced by issue 177464 bugfix (
> > > http://hg.netbeans.org/main/rev/72b27a5dbaf8 ). Please, consider whether this
> > > is a good candidate for a patch
> > 
> > This is not up to me to decide.
> I would like to have the fix in the patch if possible. I belive Vita is the one
> who can really estimate the risk.

The risk is the same as with any other patch. The question here is whether the benefits of delivering this fix in the 6.8 patch are worth the work needed to integrate the changes in release68_fixes, which I roughly estimate to .5 day. As I said this is not up to me to decide.
Comment 10 Marek Fukala 2010-01-19 07:30:54 UTC
I've made a fix on jsf.editor side which can be easily transplanted into release68 branch. QE please verify and Petre, please integrate this changeset if QE agrees. Thanks

http://hg.netbeans.org/web-main/rev/0be674f43a68
Comment 11 Jindrich Sedek 2010-01-20 07:49:16 UTC
looks good in web-main. Feel free to transplant this into 68 branch.
Comment 12 pgebauer 2010-01-20 13:48:41 UTC
The fix 0be674f43a68 has been ported into the release68_fixes repository.
http://hg.netbeans.org/release68_fixes/rev/d2f50f4b3779
Comment 13 Quality Engineering 2010-01-24 08:43:57 UTC
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0be674f43a68
User: Marek Fukala <mfukala@netbeans.org>
Log: #179377 - fix on jsf.editor side so it can be simply transplanted into release68 patch 1 (convert to composite component doesn't add namespace definition)
Comment 14 Jindrich Sedek 2010-01-27 05:02:37 UTC
verified in 68_fixes build
NetBeans IDE 6.8 (Build 201001261800)