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.
Summary: | The case of close tags characters is affected by jsp comment conten between the close and open tag | ||
---|---|---|---|
Product: | javaee | Reporter: | Jiri Kovalsky <jkovalsky> |
Component: | JSP | Assignee: | Marek Fukala <mfukala> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Jiri Kovalsky
2005-06-15 14:32:40 UTC
*** Issue 60061 has been marked as a duplicate of this issue. *** I found a minimal jsp page which demonstrates the problem: <a> <!-- ${a} --> </ The problem is caused by an html comment which contains different tokens inside (expression language, another jsp tag, directive or jsp comment). In such a case the CC end tag is not offered. caused by: javax.swing.text.BadLocationException: Misuse at 12 at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getNextElement(HTMLSyntaxSupport.java:525) at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getElementChain(HTMLSyntaxSupport.java:350) at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getPreviousElement(HTMLSyntaxSupport.java:369) at org.netbeans.editor.ext.html.SyntaxElement.getPrevious(SyntaxElement.java:82) at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getPossibleEndTags(HTMLSyntaxSupport.java:544) at org.netbeans.editor.ext.html.HTMLCompletionQuery.query(HTMLCompletionQuery.java:221) at org.netbeans.modules.web.core.syntax.completion.JspCompletionQuery.query(JspCompletionQuery.java:87) at org.netbeans.modules.web.core.syntax.completion.JspCompletionProvider.queryImpl(JspCompletionProvider.java:154) at org.netbeans.modules.web.core.syntax.completion.JspCompletionProvider$Query.query(JspCompletionProvider.java:96) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:181) at org.openide.util.Task.run(Task.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:435) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:836) This does not work in NetBeans 4.1 too. just note that tag matching doesn't work for html comments in this case as well. fixed Checking in HTMLSyntaxSupport.java; /cvs/html/editor/lib/src/org/netbeans/editor/ext/html/HTMLSyntaxSupport.java,v <-- HTMLSyntaxSupport.java new revision: 1.14; previous revision: 1.13 done It has improved indeed however one minor problem occured. Both closing tags are suggested in uppercase which is inconsistent with rest of the editor. Above stated steps to reproduce will offer </BODY> and </HTML> whereas if you type </ and invoke code completion right below opening <body> tag, code completion suggests </body> and </html>. Trying to verify in development build #200506201800 of NetBeans 4.2. I cannot reproduce it on latest build [20050621-17:00SELC]. Both html and body end tags are offered in lower case even after jsp custom tags. Please verify whether it still doesn't work. Please double check it again. If you follow the procedure exactly step by step, you will face the uppercase close tags too. Still reproducible in development build #200506221800 of NetBeans 4.2. There is a bug in "smart case" code which determines the case of the open tag. A minimal version which can reproduce the problem: <body> <%-- A --%> </BODY> The "smartcase" is totally broken - ach joooo :-(. But do not shout to me, I didn't write it. I will try to rewrite it to give reasonable results. For example: <BODY a="b"> </| + CC => completes </body> (according to the attribute case) ... or ... <A> <b></b> </| + CC => completes </a> (according to the <b> tag case) I fixed all mentined problems in this issue except the last example - the character case is gotten from first found tag backward, not from pair open tag. But it worked like that for several years and no one complained about. If someone really wants this fixed fill a P5 or P4 please. Checking in html/editor/lib/src/org/netbeans/editor/ext/html/HTMLCompletionQuery.java; /cvs/html/editor/lib/src/org/netbeans/editor/ext/html/HTMLCompletionQuery.java,v <-- HTMLCompletionQuery.java new revision: 1.22; previous revision: 1.21 done Works fine in development build #200511031900 of NetBeans 5.0. |