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 117094 - Serious issues editing JSPs (JSP editor nearly unusable)
Summary: Serious issues editing JSPs (JSP editor nearly unusable)
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: PC All
: P1 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on: 111546 114948 115819 116286 116474 116486 116518 117261 117262 117267 117268
Blocks:
  Show dependency tree
 
Reported: 2007-09-29 10:19 UTC by Martin Matula
Modified: 2007-11-02 15:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (207.22 KB, text/plain)
2007-09-29 10:21 UTC, Martin Matula
Details
Screenshot 1 (205.49 KB, image/png)
2007-09-29 10:25 UTC, Martin Matula
Details
Screenshot 2 (166.40 KB, image/png)
2007-09-29 10:26 UTC, Martin Matula
Details
Another IDE log (563.69 KB, text/plain)
2007-09-29 16:10 UTC, Martin Matula
Details
JSP I was trying to edit (11.53 KB, application/octet-stream)
2007-09-29 16:12 UTC, Martin Matula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Matula 2007-09-29 10:19:47 UTC
Sorry for reporting this as a single issue - things seem to be so broken that I don't even know how to sensibly split
this up.
Editing JSPs seems to be severely broken (I am using NB 6.0 dev build - 200709280000). I am trying to edit JSP's for
test4u project and here are the problems I am encountering:
- automatic indentation does not work correctly
- I am getting pieces of the JSP's underlined as if they were erroneous although there is no error - e.g. line like this
is underlined saying there is an unexpected character/syntax error:
        <body onload="loadPage('messages=true&restart=true', 8000);">
- there are some yellow boxes (marking usages??) placed at random positions (even whitespaces) throughout the whole file
- matching curly brackets works incorrectly
- code completion mostly does not work at all
- from time to time I am getting assertion errors and NPEs - the only way to get rid of the AssertionErrors is to close
the file and reopen it
- editing and especially scrolling through the file with the caret gets deadly slow

I am attaching my IDE log and a few screenshots of what I am seeing.
- The first screenshot shows where the caret is placed (wrongly indented) after hitting Enter at the end of the previous
line. You can also see a weird marking of an error (which is not an error at all) on the line above the caret
(underlined quotation mark in a purple box, with no corresponding annotation in the editor annotation bar on the left).
- The second one shows more weird error marks where there is no error and the random yellow boxes I mentioned.

One thing that could be relevant to this is that I am on Windows and the files I am editing have unix line breaks.
Comment 1 Martin Matula 2007-09-29 10:21:00 UTC
Created attachment 49785 [details]
IDE log file
Comment 2 Martin Matula 2007-09-29 10:25:25 UTC
Created attachment 49786 [details]
Screenshot 1
Comment 3 Martin Matula 2007-09-29 10:26:09 UTC
Created attachment 49787 [details]
Screenshot 2
Comment 4 Martin Matula 2007-09-29 16:06:23 UTC
It's just totally unusable. Attaching IDE log after another hour of struggling, trying to edit a single jsp. I was
getting IllegalStateExceptions and AssertionErrors after almost every keystroke. In the end, IDE got completely frozen
(in a deadlock probably) - unfortunately I was not able to take a thread dump easily as I did not start IDE with the
console window.
I am also attaching the file I was trying to edit.
Comment 5 Martin Matula 2007-09-29 16:10:35 UTC
Created attachment 49793 [details]
Another IDE log
Comment 6 Martin Matula 2007-09-29 16:12:03 UTC
Created attachment 49794 [details]
JSP I was trying to edit
Comment 7 jiai 2007-09-30 17:15:54 UTC
I found a very similar situation (IllegalStateExceptions, unreadable JSP files. frozen IDE) in the JSP view of the
VisualWeb projects. I believe it's the same editor, isn't it?

Product Version: NetBeans IDE 6.0 Beta 1 (Build 200709141330) Java: 1.6.0_02;
Java HotSpot(TM) Client VM 1.6.0_02-b06
System: Windows 2000 version 5.0 running on x86; Cp1252; de_DE (nb) 
Comment 8 Marek Fukala 2007-10-01 09:59:36 UTC
Thans for the feedback, I am sorry for such unusable editor there were some bigger changes in indentation recently, most
of the issue seems to be cause by some changes in editor/syntax coloring infrastructure. I'll keep trying to address
most of the issues ASAP.

As for the described problems and exceptions from the log:
Already filed issues:
#116518 P2 [editor] - java.lang.ArrayIndexOutOfBoundsException: 21
#114948 P3 [languages/engine] - java.lang.NullPointerException in AnnotationManager.java:186
#116486 P3 [html/editor] - AssertionError : Token length=0 <= 0
#116474 P2 [html/editor] - new line indentation doesn't work
#115819 P3 [web/jspeditor] - Highlighting problem
#111546 P2 [web/jspeditor] - Syntax error from scriptlets in embedded languages (not trivial fix, requires bigger
changes in both jsp editor and languages/engine) I work on the fix with Hanz on a branch.

Freshly filed issues based on the log file you provided
#117261 P2 [editor] - java.lang.AssertionError: Invalid endOffset: 4868 > line end offset = 4840
#117267 P2 [editor] - javax.swing.text.BadLocationException: Invalid offset = 2512, bias = Forward, outside of the view
<2512, 2512>, isFragment = false, fragment boundaries <2512, 2512>
#117262 P2 [languages/engine] - java.lang.IllegalStateException: Caller of TokenSequence forgot to call moveNext():
tokenIndex=0
#117268 P2 [html/editor] - java.util.ConcurrentModificationException: Caller uses token sequence which is no longer
valid. Underlying token hierarchy has been modified: modCount=626 != upToDateModCount=628

As for the code completion not working please try to be more specific what is not completed and where. I haven't heard
any complains about this recently. The same for brackets matching - do you mean matching of jsp or html tags? Or
matching in embedded languages (css, javascript)?

As for the performance I am not sure, I seems to be quite fast (except file opening (#45934)). Attaching some
threaddumps would help a lot.

Thanks for the valuable feedback!
Comment 9 Martin Matula 2007-10-01 11:12:34 UTC
Thanks for update! Here are answers to your questions:

Code completion - Maybe it was just a perceived misfunction given the other issues I had and exception pop-up windows
appearing quite often when I wanted to invoke the code completion.

Brackets matching - Brackets were matched fine when standing on an opening bracket. However, when standing on a closing
bracket, the opening one could not be found - I don't think I've ever seen this would work when standing on a closing
bracket - but I believe the opening and closing brackets were in separate scripting blocks.

Performance - Maybe part of this issue was a *perceived* poor performance due to exception windows popping up. I am
quite sure though that scrolling was objectively slow on some occasions - when I tried to move caret down with arrow
key, it responded slowly and after I stopped hitting the key it scrolled for a few more seconds scrolling down more
pages than I wanted, etc.
Comment 10 Marek Fukala 2007-10-03 18:55:14 UTC
Looks like #117339 after Tomasz' workaround does not block this P1 anymore.
Comment 11 Marek Fukala 2007-10-08 14:46:53 UTC
Most of the issues causing this one P1 has been already fixed so I am closing this "umbrella" issue. Most problematic
issue in JSP editor seems to be #116474 which will hopefuly be fixed by beta2, the rest of blocking issues should be
done to beta2 as well.

The overall impression of JSP editor is much better now.
Comment 12 Jindrich Sedek 2007-11-02 15:26:28 UTC
there are last three error on the page - #120974 - javascript
last two errors are correct - there is not start tag for <a> tag

verified.
NetBeans IDE Dev (Build 20071102062308)