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 158716 - JSP errors are not updated after it's fix
Summary: JSP errors are not updated after it's fix
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
: 160113 166963 173552 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-18 10:42 UTC by Jindrich Sedek
Modified: 2011-09-15 11:35 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2009-02-18 10:42:53 UTC
use this code in JSP file:
------------------------
<%@page import="java.util.Data"%>

<%! String message = new Date().toString(); %>
--------------------
two errors are shown -> invalid import, invalid constructor
change "java.util.Data" to "java.util.Date" -> error should be fixed, but its mark doesn't disappear

do more typing - errors are still visible. 

The only way to update errors is saving the document
Comment 1 David Konecny 2009-04-23 01:10:21 UTC
Was this assigned to me on purpose? I don't mind fixing it or having a look where is the problem. It still does not work.
Comment 2 Marek Fukala 2009-04-23 13:17:03 UTC
Looks like parsing.api versus JSP parser synchronization issue. 

These two parsers are not synchronized, but in fact the parsing.api java parser depends on jsp parser. To be able to
properly generate the java virtual source (for example beans, imports etc.) the java embedding provider (making the
"simplified jsp servlet body") needs the jsp parser result. 

However when the file is modified the parsing.api tasks runs faster than the jsp parser, so if you modify something
which is important for the virtual servlet and is obtained from jsp parser you will see the change after next parsing
round of the parsing.api parser.

To verify this simply modify the Data to Date and wait ... parsing.api wheel starts rolling ... simplified jsp servlet
is generated ... then jsp parser finishes. You can still see the error. Then do a simple modification - add a whitespace
somewhere ... parsing.api wheel rolls again ... simplified jsp servlet is regenerated, BUT with the proper previously
created jsp parsing data ... and the error is gone.

Sure this is all wrong, there needs to be some synchronization between these two. Since I plan to migrate the jsp parser
to parsing.api in next version I wouldn't loose to much time with this.

OTOH when the jsp parser finishes it fires revalidate event to the token hierarchy so if the parsing.api listened
properly on tokenhierarchy all its tasks would rerun. Even if we had this there would still be an inefficiency in
running the parsing.api tasks twice where the first run is just waste of time. Although this inefficiency happens only
if you modify something in the jsp which causes the parsing data to change (the parser change is fired only on changes
of the metadata).

I remember I saw or even filed an issue to parsing api about the token hierarchy listening so maybe doing the fix (I
suppose simple) would help quite a lot.
Comment 3 David Konecny 2009-04-23 20:57:46 UTC
Re. "if the parsing.api listened properly on tokenhierarchy all its tasks would rerun" - sounds like right solution for
this release.
Comment 4 Marek Fukala 2009-04-23 22:23:43 UTC
I doublechecked the issue and it looks like the EventSupport$DocListener from parsing api does the right job and the
problem is on jsp side. When the jsp parser finishes parsing JspColoringData.applyParsedData() method is called. It
check if on of following things changed from the last successful parser run:

1) list of taglibs
2) list of custom tag prefixes
3) if the file is jsp syntax
4) if EL is ignored in the file

The rest of the parser result content is ignored so even if it is changed the change event is not fired and hence the
JspKit$LexerColoringListener is not notified and doesn't rebuild the token hierarchy.

Looks like the simpliest fix is to fire the change event every time, better one is to also compare the list of declared
beans, imports and other stuff affecting the SimplifiedServlet generation.

I'll try to do #2 tomorrow, in the worst case #1. 

Sorry for blaming the parsing api. I really had an impression it didn't work the way it works now before some time. BTW
the issue I mentioned was filed against Schlieman and already fixed - issue #149994
Comment 5 Marek Fukala 2009-08-17 09:10:25 UTC
*** Issue 166963 has been marked as a duplicate of this issue. ***
Comment 6 Marek Fukala 2009-10-02 09:21:04 UTC
*** Issue 173552 has been marked as a duplicate of this issue. ***
Comment 7 Petr Jiricka 2009-11-04 16:23:50 UTC
The behavior is improved in NB 6.8 dev build: after correcting Data -> Date, the mark still does not disappear, but
after more typing, it does. Saving is not necessary any more, it's enough to continue typing. Jindro, can we downgrade
to P4?
Comment 8 Marek Fukala 2009-11-04 16:54:31 UTC
Nono, saving hasn't been necessary ever. What you describe is the state which is known to me and is described in detail
in one of my longer descriptions. I bet nothing changed to this issues. And finally, I wouln't downgrade, rather
upgrade. It's really nasty bug which should be fixed, but as you know the fix is really tricky.
Comment 9 Marek Fukala 2009-11-05 17:12:22 UTC
*** Issue 160113 has been marked as a duplicate of this issue. ***
Comment 10 Tomasz Slota 2010-03-15 14:54:11 UTC
Upgrading to P2, as the user impact is very severe
Comment 11 Tomasz Slota 2010-04-02 10:15:31 UTC
requesting a waiver as the fix would be very complex and is not safe to integrate it for 6.9
Comment 12 Marek Fukala 2010-04-02 14:18:42 UTC
As this issue become a P2 I should probably clarify some things mentioned in the comments above:

1) the fixes proposed in the comment#4 are only WORKAROUNDS which were ment as a temporary fixes until the main issue is fixed properly

2) the MAIN problem here is that JSP parser doesn't run within the parsing.api, it has its own infrastructure for running the parsing, getting the results by clients etc.

3) So the proper FIX is the migrate the JSP parser to the parsing.api so it is synchronized with the other parsers running on the JSP page. This would fix the synchronization problems described in comment#2.

The fix is not trivial a can be potentialy dangerous, so I agree with waiving this issue.
Comment 13 Anton Chechel 2011-01-24 13:51:21 UTC
Requesting a waiver as the fix would be very complex and is not safe to
integrate it for 7.0.
Comment 14 Petr Jiricka 2011-02-09 12:27:15 UTC
Waiver for 7.0 is approved.
Comment 15 Petr Jiricka 2011-05-04 12:56:21 UTC
Requesting a waiver for 7.0.1.
Comment 16 Petr Jiricka 2011-05-06 14:54:26 UTC
Approved.
Comment 17 Petr Jiricka 2011-09-15 11:34:22 UTC
As written above, the fix requires migration of the JSP editor to the Parsing API infrastructure, which is a large and risky task that requires a lot of resources. We are currently not planning to do that, as this is the only known problem that is not fixable within the current codebase - all other bugs we came across can be fixed without a major rewrite. Given this fact, I am closing this bug as WONTFIX - if you feel strongly that it must be fixed, please reopen with justification.