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 67978 - BadLocationException when reformating one-line JSP
Summary: BadLocationException when reformating one-line JSP
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 10:51 UTC by Jiri Prox
Modified: 2006-06-05 00:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception (2.37 KB, text/plain)
2005-11-02 10:52 UTC, Jiri Prox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2005-11-02 10:51:56 UTC
NB 5.0 dev build 051101
JDK 1.5.0_05

BadLocationException is thrown when trying to reformat jsp file containing just
one line.

Steps to reproduce:
1) create JSP file
2) remove all line except one (delete others or remove newline chars)
3) call Reformat code

javax.swing.text.BadLocationException: Invalid offset=-1 not within <0, 6>
	at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1227)
	at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1222)
Comment 1 Jiri Prox 2005-11-02 10:52:26 UTC
Created attachment 26567 [details]
exception
Comment 2 Petr Pisl 2005-11-02 12:44:30 UTC
Marku, could you look at this? It look's like a regrassion. 
Comment 3 Marek Fukala 2005-11-02 13:15:24 UTC
Petre, it is not about indentation but only about "reformatting". The exception
is printed into console only when the user invokes "reformat code" action on one
line JSP.
Comment 4 Marek Fukala 2006-01-03 18:06:41 UTC
to reporoduce delete the entire document content, put a text on the first line
and invoke reformat code.
Comment 5 Tomasz Slota 2006-01-12 09:20:07 UTC
fixed.

IDE: [1/12/06 10:08 AM] Committing "HTMLFormatter.java" started
Checking in HTMLFormatter.java;
/cvs/html/editor/lib/src/org/netbeans/editor/ext/html/HTMLFormatter.java,v  <--
 HTMLFormatter.java
new revision: 1.21; previous revision: 1.20
Comment 6 Jiri Prox 2006-01-16 11:14:41 UTC
verified